[feat:] added Country implementation for country code editing (unused)

This commit is contained in:
Elias Fierke
2026-01-01 14:45:57 +01:00
parent b82473ada2
commit 4cfbcd0ab4
3 changed files with 242 additions and 3 deletions

View File

@@ -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;
}
}