Constructor
new PieceCreator(terrain, color, piece, atOrigin)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
terrain |
Terrain | The underlying terrain this decorator wraps. |
color |
Color | The color event that triggers piece placement. |
piece |
Item | Agent | The item or agent instance to place. |
atOrigin |
boolean | When true, place at the event's origin cell instead of this cell. |
Extends
Classes
Members
terrain :Terrain
- Source:
- Overrides:
Type:
Methods
getProxiedTerrain()
- Description:
Return the terrain being wrapped (TerrainProxy interface).
- Source:
- Overrides:
onColorEventInternal(event, color, cell)
- Description:
Places PieceCreator#piece on the target cell when the received color matches PieceCreator#color. Items are added unconditionally; agents are only placed if the target cell has no existing agent.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
event |
GameEvent | |
color |
Color | |
cell |
Cell |