us.asciiroth.client.terrain
Class Reflector

java.lang.Object
  extended by us.asciiroth.client.core.AbstractPiece
      extended by us.asciiroth.client.terrain.AbstractTerrain
          extended by us.asciiroth.client.terrain.Reflector
All Implemented Interfaces:
ColorListener, Piece, Terrain

public class Reflector
extends AbstractTerrain
implements ColorListener

A reflector is an abstract puzzle piece that has a "reflector" pointing in a given direction. When a projectile of some sort is thrown or shot at a reflector, it will bounce off of it, reflected in another direction depending on the current orientation of the reflector (this is easier seen than explained). Further, the flight is extended by another standard throw as if the object had picked up energy from the reflector.


Field Summary
static Serializer<Reflector> SERIALIZER
           
 
Constructor Summary
Reflector(Direction direction, Color color)
           
 
Method Summary
 void onColorEvent(Context ctx, Cell cell, Cell origin)
          Terrain has received a color event, probably related to the firing of a color event on the board.
 void onEnter(Event event, Player player, Cell cell, Direction dir)
          Agent attempting to leave the from cell, heading toward the to cell.
 void onFlyOver(Event event, Cell cell, InFlightItem flier)
          Terrain has an item flying over it.
 
Methods inherited from class us.asciiroth.client.terrain.AbstractTerrain
canEnter, canExit, onAdjacentTo, onAgentEnter, onAgentExit, onDrop, onExit, onNotAdjacentTo, onPickup
 
Methods inherited from class us.asciiroth.client.core.AbstractPiece
getColor, getName, getSymbol, is, not
 
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, is, not
 

Field Detail

SERIALIZER

public static final Serializer<Reflector> SERIALIZER
Constructor Detail

Reflector

public Reflector(Direction direction,
                 Color color)
Method Detail

onColorEvent

public void onColorEvent(Context ctx,
                         Cell cell,
                         Cell origin)
Description copied from interface: ColorListener
Terrain has received a color event, probably related to the firing of a color event on the board. Different terrain behave differently when triggered, most flip between a set of states.

Specified by:
onColorEvent in interface ColorListener
Parameters:
ctx - a context object with references to game state

onEnter

public void onEnter(Event event,
                    Player player,
                    Cell cell,
                    Direction dir)
Description copied from interface: Terrain
Agent attempting to leave the from cell, heading toward the to cell. The terrain being used is the terrain of the to cell. The agent is still in the from
Specified by:
onEnter in interface Terrain
Overrides:
onEnter in class AbstractTerrain

onFlyOver

public void onFlyOver(Event event,
                      Cell cell,
                      InFlightItem flier)
Description copied from interface: Terrain
Terrain has an item flying over it. If the event is canceled at this point, the item will fall to the ground on this cell.

Specified by:
onFlyOver in interface Terrain
Overrides:
onFlyOver in class AbstractTerrain

0.7

2009 Alx Dark