|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.java_chess.javaChess.bitboard.BitBoardImpl
This class stores a chess board as a couple of overlayed longs (64-Bit wide).
Fields inherited from interface de.java_chess.javaChess.bitboard.BitBoard |
_LINE_A,
_LINE_B,
_LINE_C,
_LINE_D,
_LINE_E,
_LINE_F,
_LINE_G,
_LINE_H,
_NOT_LINE_A,
_NOT_LINE_B,
_NOT_LINE_C,
_NOT_LINE_D,
_NOT_LINE_E,
_NOT_LINE_F,
_NOT_LINE_G,
_NOT_LINE_H,
_NOT_ROW_1,
_NOT_ROW_2,
_NOT_ROW_3,
_NOT_ROW_4,
_NOT_ROW_5,
_NOT_ROW_6,
_NOT_ROW_7,
_NOT_ROW_8,
_ROW_1,
_ROW_2,
_ROW_3,
_ROW_4,
_ROW_5,
_ROW_6,
_ROW_7,
_ROW_8 |
Constructor Summary | |
BitBoardImpl()
Create a new instance of a chess board with pieces on their initial positions. |
Method Summary | |
protected java.lang.Object |
clone()
Create a clone of this board. |
void |
doPly(Ply ply)
Move a piece from one square to another. |
void |
emptyBoard()
Remove all the pieces from the board. |
long |
getAllPiecesForColor(boolean white)
Get all white or black pieces. |
Board |
getBoardAfterPly(Ply ply)
Return a new board, that results from a given ply. |
long |
getEmptySquares()
Get a bitmask with all the free squares. |
Piece |
getPiece(Position position)
Get the piece of a given position, or null of the square is empty. |
long |
getPositionOfPieces(int pieceTypeColor)
Get the positions of some pieces as a long (64 bit wide) bitmask. |
void |
initialPosition()
Set all the pieces to their initial positions. |
void |
setPiece(Piece piece,
Position position)
Set a piece on a given square. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public BitBoardImpl()
Method Detail |
protected final java.lang.Object clone()
public final void emptyBoard()
public final void initialPosition()
public final Piece getPiece(Position position)
position
- The position of the piece.public final void setPiece(Piece piece, Position position)
piece
- The piece to set, or null to empty the square.position
- The position of the square.public final void doPly(Ply ply)
ply
- The ply to perform.public final Board getBoardAfterPly(Ply ply)
ply
- The ply to perform.public final long getPositionOfPieces(int pieceTypeColor)
pieceTypeColor
- The color and type of the pieces.public final long getEmptySquares()
public final long getAllPiecesForColor(boolean white)
white
- true, if the white pieces are requested,
false for the black pieces.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |