Table of Contents

Class ProvinceColdData

Namespace
Core.Data
Assembly
Core.dll

Cold data storage for provinces (accessed rarely, loaded on-demand) This data is NOT synchronized in multiplayer - it's presentation/metadata only

ENGINE layer - generic province data only. Game-specific data (buildings, trade values, etc.) should be stored in customData dictionary.

public class ProvinceColdData
Inheritance
object
ProvinceColdData

Constructors

ProvinceColdData(ushort)

public ProvinceColdData(ushort provinceID)

Parameters

provinceID ushort

Properties

Bounds

public Rect Bounds { get; set; }

Property Value

Rect

CacheFrame

public int CacheFrame { get; set; }

Property Value

int

CenterPoint

public Vector2 CenterPoint { get; set; }

Property Value

Vector2

CustomData

public Dictionary<string, object> CustomData { get; }

Property Value

Dictionary<string, object>

IdentifierColor

public Color32 IdentifierColor { get; set; }

Property Value

Color32

Modifiers

public Dictionary<string, FixedPoint64> Modifiers { get; }

Property Value

Dictionary<string, FixedPoint64>

Name

public string Name { get; set; }

Property Value

string

PixelCount

public int PixelCount { get; set; }

Property Value

int

ProvinceID

public ushort ProvinceID { get; }

Property Value

ushort

RecentHistory

public CircularBuffer<HistoricalEvent> RecentHistory { get; }

Property Value

CircularBuffer<HistoricalEvent>

Methods

AddHistoricalEvent(HistoricalEvent)

Add a historical event (bounded to prevent memory growth)

public void AddHistoricalEvent(HistoricalEvent evt)

Parameters

evt HistoricalEvent

GetCustomData<T>(string, T)

Get custom data with type safety

public T GetCustomData<T>(string key, T defaultValue = default)

Parameters

key string
defaultValue T

Returns

T

Type Parameters

T

GetEstimatedMemoryUsage()

Get estimated memory usage

public int GetEstimatedMemoryUsage()

Returns

int

GetModifier(string)

Get modifier value with default zero

public FixedPoint64 GetModifier(string key)

Parameters

key string

Returns

FixedPoint64

GetModifier(string, FixedPoint64)

Get modifier value (returns FixedPoint64 for determinism)

public FixedPoint64 GetModifier(string key, FixedPoint64 defaultValue)

Parameters

key string
defaultValue FixedPoint64

Returns

FixedPoint64

GetRecentHistory()

Get recent historical events

public IReadOnlyList<HistoricalEvent> GetRecentHistory()

Returns

IReadOnlyList<HistoricalEvent>

HasCustomData(string)

Check if custom data exists

public bool HasCustomData(string key)

Parameters

key string

Returns

bool

InvalidateCache()

Invalidate cached calculations

public void InvalidateCache()

RemoveCustomData(string)

Remove custom data

public bool RemoveCustomData(string key)

Parameters

key string

Returns

bool

SetCustomData(string, object)

Set custom data

public void SetCustomData(string key, object value)

Parameters

key string
value object

SetModifier(string, FixedPoint64)

Add or update a modifier (uses FixedPoint64 for determinism)

public void SetModifier(string key, FixedPoint64 value)

Parameters

key string
value FixedPoint64