us.asciiroth.client.effects
Class InFlightItem

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

public class InFlightItem
extends AbstractEffect
implements Animated


Constructor Summary
InFlightItem(Item item, Direction direction, Piece originator)
          Constructor.
 
Method Summary
 Direction getDirection()
          Get the direction this item is currently flying.
 Item getItem()
          Get the item that is currently in flight.
 Piece getOriginator()
          The last piece that touches a flying item is essentially the originator: a piece that can't be hurt by the flying thing because it is its own ammunition.
 Symbol getSymbol()
          AbstractPiece does not support different rendering outside as opposed to inside.
 boolean is(int flag)
          Does this piece have the indicated bit flag?
 boolean not(int flag)
          Does this piece not have the indicated flag?
 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.
 void setDirection(Direction direction)
          Set the direction this item should continue to fly.
 void setItem(Item item)
          Set the item that is currently in flight.
 void setOriginator(Piece originator)
          Set the piece that originally threw or shot this item.
 
Methods inherited from class us.asciiroth.client.effects.AbstractEffect
isAboveAgent
 
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
 

Constructor Detail

InFlightItem

public InFlightItem(Item item,
                    Direction direction,
                    Piece originator)
Constructor.

Parameters:
item -
direction -
originator -
Method Detail

getDirection

public Direction getDirection()
Get the direction this item is currently flying.

Returns:
direction

getItem

public Item getItem()
Get the item that is currently in flight.

Returns:
item

getOriginator

public Piece getOriginator()
The last piece that touches a flying item is essentially the originator: a piece that can't be hurt by the flying thing because it is its own ammunition.

Returns:
the piece that last fired or touched the flying item, for pieces that change the flight path of the item.

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

is

public boolean is(int flag)
Description copied from interface: Piece
Does this piece have the indicated bit flag?

Specified by:
is in interface Piece
Overrides:
is in class AbstractPiece
Returns:
true if piece has the flag
See Also:
Flags

not

public boolean not(int flag)
Description copied from interface: Piece
Does this piece not have the indicated flag?

Specified by:
not in interface Piece
Overrides:
not in class AbstractPiece
Returns:
true if piece does not have the flag
See Also:
Flags

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

setDirection

public void setDirection(Direction direction)
Set the direction this item should continue to fly.

Parameters:
direction -

setItem

public void setItem(Item item)
Set the item that is currently in flight.

Parameters:
item -

setOriginator

public void setOriginator(Piece originator)
Set the piece that originally threw or shot this item.

Parameters:
originator -

0.7

2009 Alx Dark