use SortedSet instead of List for settings

To enforce unique entries and maintain a stable order inside of the `settings.json`.
This commit is contained in:
Robin C. Ladiges 2023-03-23 21:27:13 +01:00
parent 11c291c105
commit 7082f28e5f
No known key found for this signature in database
GPG Key ID: B494D3DF92661B99
2 changed files with 5 additions and 5 deletions

View File

@ -18,13 +18,13 @@ public static class BanLists {
}
}
private static List<string> IPs {
private static ISet<string> IPs {
get {
return Settings.Instance.BanList.IpAddresses;
}
}
private static List<Guid> Profiles {
private static ISet<Guid> Profiles {
get {
return Settings.Instance.BanList.Players;
}

View File

@ -60,13 +60,13 @@ public class Settings {
public class BanListTable {
public bool Enabled { get; set; } = false;
public List<Guid> Players { get; set; } = new List<Guid>();
public List<string> IpAddresses { get; set; } = new List<string>();
public ISet<Guid> Players { get; set; } = new SortedSet<Guid>();
public ISet<string> IpAddresses { get; set; } = new SortedSet<string>();
}
public class FlipTable {
public bool Enabled { get; set; } = true;
public List<Guid> Players { get; set; } = new List<Guid>();
public ISet<Guid> Players { get; set; } = new SortedSet<Guid>();
public FlipOptions Pov { get; set; } = FlipOptions.Both;
}