Table of Contents

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
object
CountryRegistry

Constructors

CountryRegistry(GameRegistries)

public CountryRegistry(GameRegistries gameRegistries)

Parameters

gameRegistries GameRegistries

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

tag string

Returns

bool

Exists(ushort)

Check if country ID exists

public bool Exists(ushort id)

Parameters

id ushort

Returns

bool

Get(string)

Get country by 3-letter tag (O(1) hash lookup)

public CountryData Get(string tag)

Parameters

tag string

Returns

CountryData

Get(ushort)

Get country by numeric ID (O(1) array access)

public CountryData Get(ushort id)

Parameters

id ushort

Returns

CountryData

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

tag string

Returns

ushort

Register(string, CountryData)

Register a country with its 3-letter tag

public ushort Register(string tag, CountryData country)

Parameters

tag string
country CountryData

Returns

ushort

TryGet(string, out CountryData)

Try get country by tag

public bool TryGet(string tag, out CountryData country)

Parameters

tag string
country CountryData

Returns

bool

TryGetId(string, out ushort)

Try get country ID by tag

public bool TryGetId(string tag, out ushort id)

Parameters

tag string
id ushort

Returns

bool