[feat:] added Country implementation for country code editing (unused)
This commit is contained in:
35
Settings.cs
35
Settings.cs
@@ -62,6 +62,7 @@ public class Global
|
||||
}
|
||||
|
||||
public string config_path { get; set; } = "";
|
||||
public List<Country> countries { get; set; } = new();
|
||||
|
||||
public static void Save()
|
||||
{
|
||||
@@ -144,6 +145,40 @@ public class AddressSets
|
||||
if (i.ID == ID)
|
||||
return i;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public class Country
|
||||
{
|
||||
public Country(string name, string translation, List<string> alternatives)
|
||||
{
|
||||
this.name = name;
|
||||
this.translation = translation;
|
||||
this.alternatives = alternatives;
|
||||
}
|
||||
|
||||
public Country(string name)
|
||||
{
|
||||
this.name = name;
|
||||
translation = "";
|
||||
alternatives = new List<string>();
|
||||
}
|
||||
|
||||
public Country()
|
||||
{
|
||||
}
|
||||
|
||||
public string? name { get; set; }
|
||||
public string translation { get; set; }
|
||||
public List<string> alternatives { get; set; }
|
||||
|
||||
public static Country GetByName(string name)
|
||||
{
|
||||
foreach (var country in Global._instance.countries)
|
||||
if (country.name == name)
|
||||
return country;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user