de.java_chess.javaChess.piece
Interface Piece

All Known Implementing Classes:
PieceImpl

public interface Piece

This interface has to be implemented by any chess piece.


Field Summary
static byte BISHOP
           
static byte BLACK
           
static byte KING
           
static byte KNIGHT
           
static byte PAWN
           
static byte QUEEN
           
static byte ROOK
           
static byte WHITE
           
 
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.
 

Field Detail

BLACK

public static final byte BLACK

WHITE

public static final byte WHITE

PAWN

public static final byte PAWN

BISHOP

public static final byte BISHOP

KNIGHT

public static final byte KNIGHT

ROOK

public static final byte ROOK

QUEEN

public static final byte QUEEN

KING

public static final byte KING
Method Detail

getType

public byte getType()
Get the type of this piece.
Returns:
The type of the piece.

setType

public void setType(byte type)
Set the type of this piece.
Parameters:
type - The new type of this piece.

getColor

public byte getColor()
Get the color of this piece.
Returns:
The color of this piece.

setColor

public void setColor(byte color)
Set the color of this piece.
Parameters:
The - new color of this piece.

isWhite

public boolean isWhite()
Check, if this piece is white.
Returns:
true, if this piece is white, false if black.

getTypeAndColor

public byte getTypeAndColor()
Get type and color as 1 byte.
Returns:
Type and color and 1 byte.