Constructor
new AgentDestroyer(terrain, color)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
terrain |
Terrain | The underlying terrain this decorator wraps. |
color |
Color | The color event that triggers agent removal in active mode. Pass NONE for passive mode. |
Extends
Classes
Members
terrain :Terrain
- Source:
- Overrides:
Type:
Methods
getProxiedTerrain()
- Description:
Return the terrain being wrapped (TerrainProxy interface).
- Source:
- Overrides:
onAgentEnterInternal(_event, agent, cell, dir)
- Description:
In passive mode (color is NONE), removes the agent from the cell it entered from as soon as it steps onto this cell.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
_event |
GameEvent | Unused. |
agent |
Agent | |
cell |
Cell | |
dir |
Direction |
onColorEventInternal(event, color, cell)
- Description:
In active mode, removes the agent on this cell when the received color matches AgentDestroyer#color. Skips silently when the cell has no agent.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
event |
GameEvent | Unused. |
color |
Color | |
cell |
Cell |