AgentGate

AgentGate

Restricts cell traversal to the player only — all non-player agents are prevented from both entering and exiting.

Typical use: confine enemies to a region or corridor without affecting player movement — e.g. line the border of an arena so its inhabitants cannot wander out.

Constructor

new AgentGate(terrain)

Source:
Parameters:
Name Type Description
terrain Terrain

The underlying terrain this decorator wraps.

Extends

Classes

AgentGate

Methods

canEnter()

Description:
  • Allows entry only for the player; delegates to the wrapped terrain for the player. Non-player agents are only allowed in to attack a player already standing on the cell (matching Java's AgentGate.canEnter, which checks whether the target cell already holds the player).

Source:

canExit()

Description:
  • Allows exit only for the player; delegates to the wrapped terrain for the player, and returns false for all other agents.

Source:

getProxiedTerrain()

Description:
  • Return the terrain being wrapped (TerrainProxy interface).

Source:
Overrides: