us.asciiroth.client.terrain.decorators
Class Timer

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.Timer
All Implemented Interfaces:
Animated, ColorListener, Piece, Terrain, TerrainProxy

public class Timer
extends Decorator
implements Animated

A decorator that fires a color event periodically (you can specify how fast in frames). This would be used to open close doors or the like as part of a puzzle or challenge.


Field Summary
static Serializer<Timer> SERIALIZER
           
 
Constructor Summary
Timer(Terrain terrain, Color color, int frames)
           
 
Method Summary
 void onFrame(Context ctx, Cell cell, int frame)
          Animation callback, executed once each frame for each piece animated on the board.
 Terrain proxy(Terrain terrain)
           
 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.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<Timer> SERIALIZER
Constructor Detail

Timer

public Timer(Terrain terrain,
             Color color,
             int frames)
Method Detail

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

proxy

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

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