Class CountryRegistry
- Namespace
- Core.Registries
- Assembly
- Core.dll
Specialized registry for countries with 3-letter tags Handles country-specific requirements like owned provinces tracking Following data-linking-architecture.md specifications
public class CountryRegistry
- Inheritance
-
objectCountryRegistry
Constructors
CountryRegistry(GameRegistries)
public CountryRegistry(GameRegistries gameRegistries)
Parameters
gameRegistriesGameRegistries
Properties
Count
public int Count { get; }
Property Value
- int
TypeName
public string TypeName { get; }
Property Value
- string
Methods
Exists(string)
Check if country exists
public bool Exists(string tag)
Parameters
tagstring
Returns
- bool
Exists(ushort)
Check if country ID exists
public bool Exists(ushort id)
Parameters
idushort
Returns
- bool
Get(string)
Get country by 3-letter tag (O(1) hash lookup)
public CountryData Get(string tag)
Parameters
tagstring
Returns
Get(ushort)
Get country by numeric ID (O(1) array access)
public CountryData Get(ushort id)
Parameters
idushort
Returns
GetAll()
Get all countries
public IEnumerable<CountryData> GetAll()
Returns
- IEnumerable<CountryData>
GetAllIds()
Get all valid country IDs
public IEnumerable<ushort> GetAllIds()
Returns
- IEnumerable<ushort>
GetAllTags()
Get all country tags
public IEnumerable<string> GetAllTags()
Returns
- IEnumerable<string>
GetDiagnostics()
Get diagnostic information
public string GetDiagnostics()
Returns
- string
GetId(string)
Get country ID by tag
public ushort GetId(string tag)
Parameters
tagstring
Returns
- ushort
Register(string, CountryData)
Register a country with its 3-letter tag
public ushort Register(string tag, CountryData country)
Parameters
tagstringcountryCountryData
Returns
- ushort
TryGet(string, out CountryData)
Try get country by tag
public bool TryGet(string tag, out CountryData country)
Parameters
tagstringcountryCountryData
Returns
- bool
TryGetId(string, out ushort)
Try get country ID by tag
public bool TryGetId(string tag, out ushort id)
Parameters
tagstringidushort
Returns
- bool