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:
parent
11c291c105
commit
7082f28e5f
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue