|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectsuicideChess.Board
public class Board
This class contains the board representation. The board is represented using bitboards.
| Nested Class Summary | |
|---|---|
class |
Board.NoPieceOnSquare
|
| Field Summary | |
|---|---|
static int |
NB_OF_FILES
|
static int |
NB_OF_RANKS
|
static int |
NB_OF_SQUARES
|
| Constructor Summary | |
|---|---|
Board()
Constructor of the class Board |
|
| Method Summary | |
|---|---|
void |
display()
This function can be used to display the board Black pieces are displayed in uppercase letters. |
void |
doMove(Move move)
This methods takes a Move and applies it (updating the bitboard) |
Square |
getEnPassantSquare()
This function is used to return the 'en passant' Square. |
Piece |
getPiece(Square onSquare)
This function searchs for what piece is on a square. |
boolean |
isEmpty(Square square,
Piece piece)
This function returns a boolean telling if a Piece is on a Board.NoPieceOnSquare. |
boolean |
isEnPassant()
This function returns a boolean saying if the board is in an 'en passant' state. |
static int |
squareToBitBoardSquare(Square square)
This function converts a Board.NoPieceOnSquare to a number representing a bitboard square |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NB_OF_RANKS
public static final int NB_OF_FILES
public static final int NB_OF_SQUARES
| Constructor Detail |
|---|
public Board()
throws Square.NotAValidSquare
Square.NotAValidSquare| Method Detail |
|---|
public void doMove(Move move)
throws Board.NoPieceOnSquare
Move and applies it (updating the bitboard)
move - The move that is to be done
Board.NoPieceOnSquare - If a piece is trying to be moved from a square that does not exist.Movepublic Piece getPiece(Square onSquare)
onSquare - The Square on which we will look for a piece.
PieceBoard.NoPieceOnSquare,
Piece
public boolean isEmpty(Square square,
Piece piece)
Piece is on a Board.NoPieceOnSquare.
square - The Squarepiece - A Piece constant
Piece,
Board.NoPieceOnSquarepublic static int squareToBitBoardSquare(Square square)
Board.NoPieceOnSquare to a number representing a bitboard square
square - The Square to be converted
Board.NoPieceOnSquarepublic boolean isEnPassant()
public Square getEnPassantSquare()
Board.NoPieceOnSquarepublic void display()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||