us.asciiroth.client.effects
Class Fade

java.lang.Object
  extended by us.asciiroth.client.core.AbstractPiece
      extended by us.asciiroth.client.effects.AbstractEffect
          extended by us.asciiroth.client.effects.Fade
All Implemented Interfaces:
Animated, Effect, Piece

public class Fade
extends AbstractEffect
implements Animated

Character fading. I give up: the effect animations are stateful. You wouldn't believe the complexity of dealing with one animated piece calling another animated piece's getSymbol() method, and getting the wrong animation state. No answer is better, such as storing state in the animation proxies, partial rendering based on the current appearance of the cell, etc.


Constructor Summary
Fade(Symbol symbol, com.google.gwt.user.client.Command command)
          Constructor.
 
Method Summary
 Symbol getSymbol()
          AbstractPiece does not support different rendering outside as opposed to inside.
 boolean isAboveAgent()
          Should this effect be displayed above or below an agent if an agent appears on the same cell?
 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.core.AbstractPiece
getColor, getName, 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, is, not
 

Constructor Detail

Fade

public Fade(Symbol symbol,
            com.google.gwt.user.client.Command command)
Constructor.

Parameters:
symbol -
command -
Method Detail

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

isAboveAgent

public boolean isAboveAgent()
Description copied from interface: Effect
Should this effect be displayed above or below an agent if an agent appears on the same cell?

Specified by:
isAboveAgent in interface Effect
Overrides:
isAboveAgent in class AbstractEffect
Returns:
true if this effect should appear above the agent

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