us.asciiroth.client.terrain.decorators
Class Mimic

java.lang.Object
  extended by us.asciiroth.client.core.AbstractPiece
      extended by us.asciiroth.client.terrain.decorators.Decorator
          extended by us.asciiroth.client.terrain.decorators.Mimic
All Implemented Interfaces:
ColorListener, Piece, Terrain, TerrainProxy
Direct Known Subclasses:
PitTrap, SecretPassage

public class Mimic
extends Decorator
implements TerrainProxy

A mimic looks like one kind of terrain, but is entirely another kind of terrain in behavior. Agents are not fooled by the appearance of mimics.


Field Summary
static Serializer<Mimic> SERIALIZER
          Type serializer.
 
Method Summary
 Terrain getProxiedTerrain()
           
 Symbol getSymbol()
          AbstractPiece does not support different rendering outside as opposed to inside.
 void onAdjacentTo(Context context, Cell cell)
          This terrain is adjacent to the player.
 void onNotAdjacentTo(Context context, Cell cell)
          This terrain is no longer adjacent to the player.
 Terrain proxy(Terrain terrain)
          Creates a proxy where the supplied terrain replaces the terrain the mimic appears as (it remains the same actual terrain).
 
Methods inherited from class us.asciiroth.client.terrain.decorators.Decorator
canEnter, canExit, is, not, onAgentEnter, onAgentExit, onColorEvent, onDrop, onEnter, onExit, onFlyOver, onPickup
 
Methods inherited from class us.asciiroth.client.core.AbstractPiece
getColor, getName
 
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
 

Field Detail

SERIALIZER

public static final Serializer<Mimic> SERIALIZER
Type serializer.

Method Detail

getProxiedTerrain

public Terrain getProxiedTerrain()
Specified by:
getProxiedTerrain in interface TerrainProxy
Overrides:
getProxiedTerrain in class Decorator
Returns:
the proxied terrain which will be used for rendering

getSymbol

public Symbol getSymbol()
Description copied from class: AbstractPiece
AbstractPiece does not support different rendering outside as opposed to inside. Subclasses must implement this.

Specified by:
getSymbol in interface Piece
Overrides:
getSymbol in class AbstractPiece
Returns:
the symbol for this piece

onAdjacentTo

public void onAdjacentTo(Context context,
                         Cell cell)
Description copied from interface: Terrain
This terrain is adjacent to the player. It may render differently under these circumstances.

Specified by:
onAdjacentTo in interface Terrain
Overrides:
onAdjacentTo in class Decorator

onNotAdjacentTo

public void onNotAdjacentTo(Context context,
                            Cell cell)
Description copied from interface: Terrain
This terrain is no longer adjacent to the player. It may render differently under these circumstances.

Specified by:
onNotAdjacentTo in interface Terrain
Overrides:
onNotAdjacentTo in class Decorator

proxy

public Terrain proxy(Terrain terrain)
Creates a proxy where the supplied terrain replaces the terrain the mimic appears as (it remains the same actual terrain).

Specified by:
proxy in interface TerrainProxy
Returns:
a new proxy, with the same behavior but wrapping a different terrain

0.7

© 2009 Alx Dark