Table of Contents

Interface IMapModeColorizer

Namespace
Map.MapModes.Colorization
Assembly
MapAssembly.dll

ENGINE: Interface for pluggable map mode colorization strategies.

Pattern 20: Pluggable Implementation Pattern

  • ENGINE provides interface + default implementation (gradient-based)
  • GAME registers custom implementations via MapRendererRegistry
  • VisualStyleConfiguration references by string ID

Default: GradientMapModeColorizer (3-color linear interpolation) Custom examples: DiscreteColorBands, MultiGradient, PatternOverlay, AnimatedEffects

public interface IMapModeColorizer

Properties

ColorizerId

Unique identifier for this colorizer (e.g., "Gradient", "DiscreteBands", "MultiColor")

string ColorizerId { get; }

Property Value

string

DisplayName

Human-readable name for UI/debugging

string DisplayName { get; }

Property Value

string

RequiresPerFrameUpdate

Whether this colorizer needs per-frame updates (e.g., animated effects)

bool RequiresPerFrameUpdate { get; }

Property Value

bool

Methods

Colorize(RenderTexture, RenderTexture, float[], ColorizationStyleParams)

Apply colorization to generate output texture. Core operation: province values + style params → colored texture

void Colorize(RenderTexture provinceIDTexture, RenderTexture outputTexture, float[] provinceValues, ColorizationStyleParams styleParams)

Parameters

provinceIDTexture RenderTexture

Input: Province ID texture (RG16 encoded)

outputTexture RenderTexture

Output: Colorized RGBA texture

provinceValues float[]

Per-province normalized values (0-1), negative = skip

styleParams ColorizationStyleParams

Colorization style parameters

Dispose()

Release GPU resources.

void Dispose()

Initialize(MapModeColorizerContext)

Initialize the colorizer with required resources. Called once when colorizer is first activated.

void Initialize(MapModeColorizerContext context)

Parameters

context MapModeColorizerContext

OnRenderFrame()

Called each frame if RequiresPerFrameUpdate is true. Use for animated effects, pulsing, etc.

void OnRenderFrame()