Constructor
new Timer(terrain, color, frames)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
terrain |
Terrain | The underlying terrain this decorator wraps. |
color |
Color | The color event broadcast on each tick. |
frames |
number | Interval in animation frames between firings. Values ≤ 0 are clamped to 1. |
Extends
Classes
Members
terrain :Terrain
- Source:
- Overrides:
Type:
Methods
getProxiedTerrain()
- Description:
Return the terrain being wrapped (TerrainProxy interface).
- Source:
- Overrides:
onFrame(_ctx, cell, frame)
- Description:
Called by the AnimationManager on each animation tick. Fires the color event on the board whenever the frame counter is a positive multiple of Timer#_frames.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
_ctx |
CanvasRenderingContext2D | Unused. |
cell |
Cell | |
frame |
number | Current animation frame counter. |
proxy()
- Description:
Returns a new Timer wrapping the given terrain, preserving color and interval.
- Source: