us.asciiroth.client.terrain
Class Shooter

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

public class Shooter
extends AbstractTerrain
implements Animated, ColorListener

A terrain type that shoots some form of ammunition (actually, it'll shoot anything... for what that's worth), in a given direction, or in a random direction if the direction None is specified.


Field Summary
static Serializer<Shooter> SERIALIZER
          Type serializer.
 
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 onFlyOver(Event event, Cell cell, InFlightItem flier)
          Terrain has an item flying over it.
 void onFrame(Context ctx, Cell cell, int frame)
          Animation callback, executed once each frame for each piece animated on the board.
 boolean randomSeed()
          Should this animation start with a randomly seeded number as its first frame? For some animations, this can prevent all presentations of the piece on the board executing the same animation frame at the same time.
 
Methods inherited from class us.asciiroth.client.terrain.AbstractTerrain
canEnter, canExit, onAdjacentTo, onAgentEnter, onAgentExit, onDrop, onEnter, 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<Shooter> SERIALIZER
Type serializer.

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

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

onFrame

public void onFrame(Context ctx,
                    Cell cell,
                    int frame)
Description copied from interface: Animated
Animation callback, executed once each frame for each piece animated on the board.

Specified by:
onFrame in interface Animated

randomSeed

public boolean randomSeed()
Description copied from interface: Animated
Should this animation start with a randomly seeded number as its first frame? For some animations, this can prevent all presentations of the piece on the board executing the same animation frame at the same time.

Specified by:
randomSeed in interface Animated
Returns:
true if a random frame should begin the animated piece's timeline

0.7

© 2009 Alx Dark