Class BaseMapModeHandler
Base class for map mode handlers with common functionality
public abstract class BaseMapModeHandler : IMapModeHandler
- Inheritance
-
objectBaseMapModeHandler
- Implements
- Derived
Properties
Mode
Map mode type this handler manages
public abstract MapMode Mode { get; }
Property Value
Name
Display name for UI
public abstract string Name { get; }
Property Value
- string
RequiresFrequentUpdates
Whether this mode requires frequent texture updates
public virtual bool RequiresFrequentUpdates { get; }
Property Value
- bool
ShaderModeID
Shader mode ID for the GPU
public abstract int ShaderModeID { get; }
Property Value
- int
Methods
DisableAllMapModeKeywords(Material)
Utility: Disable all map mode keywords in the shader
protected void DisableAllMapModeKeywords(Material material)
Parameters
materialMaterial
EnableMapModeKeyword(Material, string)
Utility: Enable a specific map mode keyword
protected void EnableMapModeKeyword(Material material, string keyword)
Parameters
materialMaterialkeywordstring
GetProvinceTooltip(ushort, ProvinceQueries, CountryQueries)
Get tooltip text for a specific province in this map mode
public abstract string GetProvinceTooltip(ushort provinceId, ProvinceQueries provinceQueries, CountryQueries countryQueries)
Parameters
provinceIdushortprovinceQueriesProvinceQueriescountryQueriesCountryQueries
Returns
- string
GetUpdateFrequency()
Get update frequency for this map mode's textures
public abstract UpdateFrequency GetUpdateFrequency()
Returns
LogActivation(string)
Utility: Log mode activation
protected void LogActivation(string message = null)
Parameters
messagestring
LogDeactivation(string)
Utility: Log mode deactivation
protected void LogDeactivation(string message = null)
Parameters
messagestring
OnActivate(Material, MapModeDataTextures)
Called when this map mode becomes active Set up shader properties, enable keywords, etc.
public abstract void OnActivate(Material mapMaterial, MapModeDataTextures dataTextures)
Parameters
mapMaterialMaterialdataTexturesMapModeDataTextures
OnDeactivate(Material)
Called when this map mode becomes inactive Clean up, disable keywords, etc.
public abstract void OnDeactivate(Material mapMaterial)
Parameters
mapMaterialMaterial
SetShaderMode(Material, int)
Utility: Set common shader properties
protected void SetShaderMode(Material material, int modeId)
Parameters
materialMaterialmodeIdint
UpdateTextures(MapModeDataTextures, ProvinceQueries, CountryQueries, ProvinceMapping, object)
Update the mode-specific data textures from Core simulation data Only called when data has changed or mode requires frequent updates
public abstract void UpdateTextures(MapModeDataTextures dataTextures, ProvinceQueries provinceQueries, CountryQueries countryQueries, ProvinceMapping provinceMapping, object gameProvinceSystem = null)
Parameters
dataTexturesMapModeDataTexturesprovinceQueriesProvinceQueriescountryQueriesCountryQueriesprovinceMappingProvinceMappinggameProvinceSystemobjectOptional game-specific province system - engine passes through without knowing type