Class ProvinceColdData
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
-
objectProvinceColdData
Constructors
ProvinceColdData(ushort)
public ProvinceColdData(ushort provinceID)
Parameters
provinceIDushort
Properties
Bounds
public Rect Bounds { get; set; }
Property Value
CacheFrame
public int CacheFrame { get; set; }
Property Value
- int
CenterPoint
public Vector2 CenterPoint { get; set; }
Property Value
CustomData
public Dictionary<string, object> CustomData { get; }
Property Value
- Dictionary<string, object>
IdentifierColor
public Color32 IdentifierColor { get; set; }
Property Value
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
Methods
AddHistoricalEvent(HistoricalEvent)
Add a historical event (bounded to prevent memory growth)
public void AddHistoricalEvent(HistoricalEvent evt)
Parameters
evtHistoricalEvent
GetCustomData<T>(string, T)
Get custom data with type safety
public T GetCustomData<T>(string key, T defaultValue = default)
Parameters
keystringdefaultValueT
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
keystring
Returns
GetModifier(string, FixedPoint64)
Get modifier value (returns FixedPoint64 for determinism)
public FixedPoint64 GetModifier(string key, FixedPoint64 defaultValue)
Parameters
keystringdefaultValueFixedPoint64
Returns
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
keystring
Returns
- bool
InvalidateCache()
Invalidate cached calculations
public void InvalidateCache()
RemoveCustomData(string)
Remove custom data
public bool RemoveCustomData(string key)
Parameters
keystring
Returns
- bool
SetCustomData(string, object)
Set custom data
public void SetCustomData(string key, object value)
Parameters
keystringvalueobject
SetModifier(string, FixedPoint64)
Add or update a modifier (uses FixedPoint64 for determinism)
public void SetModifier(string key, FixedPoint64 value)
Parameters
keystringvalueFixedPoint64