|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.java_chess.javaChess.piece.PieceImpl
This class implements the functionality for a piece.
Fields inherited from interface de.java_chess.javaChess.piece.Piece |
BISHOP,
BLACK,
KING,
KNIGHT,
PAWN,
QUEEN,
ROOK,
WHITE |
Constructor Summary | |
PieceImpl(byte typeColor)
Create a new piece instance. |
|
PieceImpl(byte type,
byte color)
Create a new Piece instance from type and color. |
Method Summary | |
byte |
getColor()
Get the color of this piece. |
byte |
getType()
Get the type of this piece. |
byte |
getTypeAndColor()
Get type and color as 1 byte. |
boolean |
isWhite()
Check, if this piece is white. |
void |
setColor(byte color)
Set the color of this piece. |
void |
setType(byte type)
Set the type of this piece. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public PieceImpl(byte typeColor)
typeColor
- The color and type of piece, with color in bit 0
and the type color in bit 1-3.public PieceImpl(byte type, byte color)
type
- The type of the piece.color
- The color of the piece.Method Detail |
public final byte getType()
public final void setType(byte type)
type
- The type of this piece as defined as
constants in the Piece interface.public final byte getColor()
public final void setColor(byte color)
The
- new color of this piece.public final boolean isWhite()
public final byte getTypeAndColor()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |