Table of Contents

Class HighlightRendererBase

Namespace
Map.Rendering.Highlight
Assembly
MapAssembly.dll

ENGINE: Abstract base class for highlight renderers with common functionality. Extend this class to create custom highlight renderers.

public abstract class HighlightRendererBase : IHighlightRenderer
Inheritance
object
HighlightRendererBase
Implements
Derived

Fields

THREAD_GROUP_SIZE

protected const int THREAD_GROUP_SIZE = 8

Field Value

int

context

protected HighlightRendererContext context

Field Value

HighlightRendererContext

currentHighlightColor

protected Color currentHighlightColor

Field Value

Color

currentHighlightedProvince

protected ushort currentHighlightedProvince

Field Value

ushort

currentMode

protected HighlightMode currentMode

Field Value

HighlightMode

isInitialized

protected bool isInitialized

Field Value

bool

textureManager

protected MapTextureManager textureManager

Field Value

MapTextureManager

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

material Material
styleParams HighlightStyleParams

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

material Material
styleParams HighlightStyleParams

CalculateThreadGroups(int, int)

Utility: Calculate thread groups for compute shader dispatch.

protected (int x, int y) CalculateThreadGroups(int width, int height)

Parameters

width int
height int

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

countryID ushort

Country ID to highlight

color Color

Highlight color with alpha

HighlightProvince(ushort, Color, HighlightMode)

Highlight a single province.

public abstract void HighlightProvince(ushort provinceID, Color color, HighlightMode mode)

Parameters

provinceID ushort

Province to highlight (0 = clear)

color Color

Highlight color with alpha

mode HighlightMode

Fill 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

texManager MapTextureManager
ctx HighlightRendererContext

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()