|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.editev.chess.Chess
|
+--com.editev.chess.Board
Represent just the Pieces on the 64 Squares of the chess board as byte indices.
the source here.| Inner classes inherited from class com.editev.chess.Chess |
Chess.Black,
Chess.White |
| Field Summary | |
static char[] |
PIECE_NAMES
Character identifiers for the pieces. |
static Piece[] |
PIECES
A list of Pieces for each piece index which is used to translate the indices representing pieces in the Board into Pieces with rules. |
private byte[][] |
squares
The actual 64 squares in an 8x8 array. |
| Fields inherited from class com.editev.chess.Chess |
BLACK,
NO_MOVE,
NO_PIECE,
WHITE |
| Constructor Summary | |
Board()
|
|
| Method Summary | |
java.lang.Object |
clone()
A deep copy clone(). |
Board |
cloneBoard()
A deep copy clone() that returns a Board. |
void |
copyFrom(Board board)
Copy the contents of another Board into this Board. |
boolean |
equals(java.lang.Object x)
Two boards are equal if all their squares are equal. |
Square |
findPieceSquare(byte piece)
Find a Piece on the board. |
Piece |
getPiece(Move move)
Gets the Piece being Moved.. |
Piece |
getPiece(Square sq)
Gets the Piece at the given square. |
byte |
getPieceIndex(Move move)
Get a piece index by source of Move. |
byte |
getPieceIndex(Square sq)
Get a piece index by Square. |
boolean |
hasPiece(Square sq)
Is there a piece on this square? @return true if there is a piece at this Square |
boolean |
inCheck(boolean isWhite)
Is the king of this color in check? |
boolean |
isAttacked(boolean whitesMove,
Square square)
Is this square attacked? |
boolean |
resultsInCheck(Move move,
Piece piece)
Does this move result in check? |
void |
setPieceIndex(Square sq,
byte piece)
Set a piece index by Square. |
java.lang.String |
toString()
|
| Methods inherited from class com.editev.chess.Chess |
notColor,
toColor,
toColor,
toColorName |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private final byte[][] squares
public static Piece[] PIECES
public static final char[] PIECE_NAMES
| Constructor Detail |
public Board()
| Method Detail |
public byte getPieceIndex(Square sq)
public byte getPieceIndex(Move move)
public void setPieceIndex(Square sq,
byte piece)
public boolean hasPiece(Square sq)
public Piece getPiece(Square sq)
sq - the Square on the Board containing the Piece.public Piece getPiece(Move move)
sq - the Square on the Board containing the Piece.public Square findPieceSquare(byte piece)
public boolean inCheck(boolean isWhite)
public boolean resultsInCheck(Move move,
Piece piece)
public boolean isAttacked(boolean whitesMove,
Square square)
public boolean equals(java.lang.Object x)
public java.lang.Object clone()
public Board cloneBoard()
public void copyFrom(Board board)
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||