us.asciiroth.client.core
Class AbstractPiece

java.lang.Object
  extended by us.asciiroth.client.core.AbstractPiece
All Implemented Interfaces:
Piece
Direct Known Subclasses:
AbstractAgent, AbstractEffect, AbstractItem, AbstractTerrain, Decorator

public abstract class AbstractPiece
extends java.lang.Object
implements Piece

Abstract implementation of a piece.


Constructor Summary
AbstractPiece(java.lang.String name, int flags, Color color, Symbol symbol)
          Constructor.
AbstractPiece(java.lang.String name, int flags, Symbol symbol)
          Constructor.
 
Method Summary
 Color getColor()
          What is the color of this piece? While many piece types are permanently of color "None", many more can be parameterized with a color in order to tie them together through color-based events.
 java.lang.String getName()
          The visible name of the piece.
 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?
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPiece

public AbstractPiece(java.lang.String name,
                     int flags,
                     Color color,
                     Symbol symbol)
Constructor.

Parameters:
name -
flags -
color -
symbol -

AbstractPiece

public AbstractPiece(java.lang.String name,
                     int flags,
                     Symbol symbol)
Constructor.

Parameters:
name -
flags -
symbol -
Method Detail

getColor

public Color getColor()
Description copied from interface: Piece
What is the color of this piece? While many piece types are permanently of color "None", many more can be parameterized with a color in order to tie them together through color-based events.

Specified by:
getColor in interface Piece
Returns:
the Color of this piece

getName

public java.lang.String getName()
Description copied from interface: Piece
The visible name of the piece.

Specified by:
getName in interface Piece
Returns:
the name of the piece as displayed to the user.

getSymbol

public Symbol getSymbol()
AbstractPiece does not support different rendering outside as opposed to inside. Subclasses must implement this.

Specified by:
getSymbol in interface Piece
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
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
Returns:
true if piece does not have the flag
See Also:
Flags

0.7

© 2009 Alx Dark