us.asciiroth.client.terrain.triggers
Class Trigger

java.lang.Object
  extended by us.asciiroth.client.core.AbstractPiece
      extended by us.asciiroth.client.terrain.decorators.Decorator
          extended by us.asciiroth.client.terrain.triggers.Trigger
All Implemented Interfaces:
ColorListener, Piece, Terrain, TerrainProxy
Direct Known Subclasses:
TriggerIf, TriggerIfNot, TriggerOnce

public class Trigger
extends Decorator

Triggers a color event when entered without any conditions. In this sense, not a lot different than a switch, but invisible. Subclasses of trigger are generally more useful.


Field Summary
static Serializer<Trigger> SERIALIZER
          Type serializer.
 
Method Summary
 java.lang.String getMessage()
          Get the message or URL for this trigger.
 void onEnterInternal(Event event, Player player, Cell cell, Direction dir)
          Override this method in subclasses in order to augment the onEnter behavior of the decorated terrain.
 Terrain proxy(Terrain terrain)
           
 
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 us.asciiroth.client.core.AbstractPiece
getColor, getName, getSymbol
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface us.asciiroth.client.core.Piece
getColor, getName, getSymbol
 

Field Detail

SERIALIZER

public static final Serializer<Trigger> SERIALIZER
Type serializer.

Method Detail

getMessage

public java.lang.String getMessage()
Get the message or URL for this trigger. Can either be the text itself (will be displayed inline) or an URL to an HTML file that will be displayed in a modal dialog.

Returns:
A message to display inline or, if the string ends in ".html", the url to an HTML file to display in a modal dialog.

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

0.7

© 2009 Alx Dark