us.asciiroth.client.terrain.decorators
Class PlayerGate
java.lang.Object
us.asciiroth.client.core.AbstractPiece
us.asciiroth.client.terrain.decorators.Decorator
us.asciiroth.client.terrain.decorators.PlayerGate
- All Implemented Interfaces:
- ColorListener, Piece, Terrain, TerrainProxy
public class PlayerGate
- extends Decorator
A player gate decorates another terrain and tests to see if the player
has a specific flag or item. It will block movement if the player does
not, and optionally show a modal message to the user if he/she is blocked.
(The message is modal to match the behavior of talking to an NPC).
This can be used in tandom with NPCs to simulate situations where an
agent will not allow the player to pass until a condition is met. It
can probably be used for other things as well.
Constructor Summary |
PlayerGate(Terrain terrain,
java.lang.String flag,
java.lang.String message)
|
Methods inherited from class us.asciiroth.client.terrain.decorators.Decorator |
canEnter, canExit, getProxiedTerrain, is, not, onAdjacentTo, onAgentEnter, onAgentExit, onColorEvent, onDrop, onEnter, onExit, onFlyOver, onNotAdjacentTo, onPickup |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERIALIZER
public static final Serializer<PlayerGate> SERIALIZER
- Type serializer.
PlayerGate
public PlayerGate(Terrain terrain,
java.lang.String flag,
java.lang.String message)
onEnterInternal
public void onEnterInternal(Event event,
Player player,
Cell cell,
Direction dir)
- Description copied from class:
Decorator
- Override this method in subclasses in order to augment the onEnter
behavior of the decorated terrain.
proxy
public Terrain proxy(Terrain terrain)
- Returns:
- a new proxy, with the same behavior but wrapping a
different terrain
© 2009 Alx Dark