Class HighlightRendererBase
ENGINE: Abstract base class for highlight renderers with common functionality. Extend this class to create custom highlight renderers.
public abstract class HighlightRendererBase : IHighlightRenderer
- Inheritance
-
objectHighlightRendererBase
- Implements
- Derived
Fields
THREAD_GROUP_SIZE
protected const int THREAD_GROUP_SIZE = 8
Field Value
- int
context
protected HighlightRendererContext context
Field Value
currentHighlightColor
protected Color currentHighlightColor
Field Value
currentHighlightedProvince
protected ushort currentHighlightedProvince
Field Value
- ushort
currentMode
protected HighlightMode currentMode
Field Value
isInitialized
protected bool isInitialized
Field Value
- bool
textureManager
protected MapTextureManager textureManager
Field Value
Properties
DisplayName
Display name for UI/debugging
public abstract string DisplayName { get; }
Property Value
- string
RendererId
Unique identifier for this renderer (e.g., "Default", "Glow", "Pulse")
public abstract string RendererId { get; }
Property Value
- string
RequiresPerFrameUpdate
Whether this renderer requires per-frame updates (e.g., animated effects)
public virtual bool RequiresPerFrameUpdate { get; }
Property Value
- bool
Methods
ApplyCommonStyleParams(Material, HighlightStyleParams)
Utility: Apply common highlight style parameters to material.
protected void ApplyCommonStyleParams(Material material, HighlightStyleParams styleParams)
Parameters
materialMaterialstyleParamsHighlightStyleParams
ApplyToMaterial(Material, HighlightStyleParams)
Apply visual parameters to the material (colors, effects, etc.) Called when visual style parameters change.
public abstract void ApplyToMaterial(Material material, HighlightStyleParams styleParams)
Parameters
materialMaterialstyleParamsHighlightStyleParams
CalculateThreadGroups(int, int)
Utility: Calculate thread groups for compute shader dispatch.
protected (int x, int y) CalculateThreadGroups(int width, int height)
Parameters
widthintheightint
Returns
- (int x, int y)
ClearHighlight()
Clear all highlights.
public abstract void ClearHighlight()
Dispose()
Cleanup resources when renderer is deactivated or destroyed.
public abstract void Dispose()
GetHighlightedProvince()
Get the currently highlighted province ID.
public ushort GetHighlightedProvince()
Returns
- ushort
HighlightCountry(ushort, Color)
Highlight all provinces owned by a country.
public abstract void HighlightCountry(ushort countryID, Color color)
Parameters
countryIDushortCountry ID to highlight
colorColorHighlight color with alpha
HighlightProvince(ushort, Color, HighlightMode)
Highlight a single province.
public abstract void HighlightProvince(ushort provinceID, Color color, HighlightMode mode)
Parameters
provinceIDushortProvince to highlight (0 = clear)
colorColorHighlight color with alpha
modeHighlightModeFill or border-only mode
Initialize(MapTextureManager, HighlightRendererContext)
Initialize the renderer with required resources. Called once when renderer is first activated.
public virtual void Initialize(MapTextureManager texManager, HighlightRendererContext ctx)
Parameters
texManagerMapTextureManagerctxHighlightRendererContext
OnInitialize()
Override for custom initialization logic. Called after textureManager and context are set.
protected abstract void OnInitialize()
OnRenderFrame()
Called per-frame for renderers that need continuous updates (animations). Only called if RequiresPerFrameUpdate is true.
public virtual void OnRenderFrame()