us.asciiroth.client.terrain.decorators
Class ColorRelay
java.lang.Object
us.asciiroth.client.core.AbstractPiece
us.asciiroth.client.terrain.decorators.Decorator
us.asciiroth.client.terrain.decorators.ColorRelay
- All Implemented Interfaces:
- ColorListener, Piece, Terrain, TerrainProxy
public class ColorRelay
- extends Decorator
A terrain that looks like the terrain it decorates, and is for all
purposes the terrain it looks like, but when it receives a color event,
it triggers an event of a different color.
Why is this useful? Let's say you want to have six doors that all
open with one key using a key switch. The problem is that the key can
only open one door, which will consume it. With a color relay,
an orange key switch can trigger an orange color event, and the relay
can convert this to another color, let's say a blue color event. Now
an orange key can open six blue doors via the orange key switch.
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<ColorRelay> SERIALIZER
- Type serializer.
onColorEventInternal
public void onColorEventInternal(Context ctx,
Cell cell,
Cell origin)
- Description copied from class:
Decorator
- Override this method in subclasses in order to augment the onTrigger
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