Belofte version 2.1.9
A promising chess program using the UCI or Winboard interface
|
board More...
#include <board.h>
Public Member Functions | |
bBoard (bBoard const &b) | |
Copy board with limited board data, no board history. | |
bBoard (bBoard const &b, bMove &m) | |
Create copy of board with limited board data and history. | |
bBoard (bFen const &fen) | |
used by setFENInitialPos | |
~bBoard () override | |
bBoard & | operator= (bBoard const &b)=delete |
bBoard & | operator= (bBoard &&b)=delete |
void | invertColours () |
invert colours update kingpos, update colour to move, castle rights, ... | |
constexpr bGameStage | getGameStage () const |
void | clearGameStage () |
std::string | getGameStageName () const |
void | calcGameStage () |
calculate stage of game to assist in evaluation | |
constexpr bool | needCalcMinorPieces () const |
constexpr bool | noNeedCalcMinorPieces () const |
void | setNeedCalcMinorPieces () |
void | clearNeedCalcMinorPieces () |
void | calcMinorPieces (bool const bForceRecalc=false) |
Recalculate minor pieces, used for evaluation and end of game condition in case of less than 5 pieces. | |
constexpr bmove_t | getMove () const |
void | clearMove () |
void | setMove (bmove_t const bmt) |
movesequence_t const & | getPreviousMoves () const |
void | setPreviousMoves (movesequence_t const &v) |
movesequence_t const & | getVariation () const |
void | clearVariation () |
void | setVariation (bBoard const &chldbrd) |
boardInfo_t | applyMove (bMove const &m) override |
modification of board move is kept on previous board newboard does not have move stored and has flag to recalculate minor pieces | |
operator std::string () const | |
print board | |
![]() | |
bBasicBoard (bBasicBoard const &bb) | |
virtual | ~bBasicBoard () |
constexpr plynum_t | getPly () const |
void | setPly (plynum_t const p) |
void | incPly () |
void | decPly () |
constexpr bool | isEpSet () const |
constexpr case_t | getEp () const |
constexpr column_t | getEpColumn () const |
void | setEp (case_t const e) |
set ep case, it will actually be stored as column only rank will be calculated based on side to move function is never called to clear ep case or when ep is not set | |
void | clearEp () |
constexpr movenum50_t | getPly50Moves () const |
void | setPly50Moves (movenum50_t const p) |
void | incPly50Moves () |
void | clearPly50Moves () |
constexpr bool | hasCastleRights (uint8_t const f) const |
void | setWhiteHasCastled () |
void | setBlackHasCastled () |
void | clearWhiteHasCastled () |
void | clearBlackHasCastled () |
constexpr bool | whiteHasCastled () const |
constexpr bool | blackHasCastled () const |
void | setCastleRights (uint8_t const f) |
void | setCastleRights (uint8_t const f, bool const c) |
void | clearCastleRights (uint8_t const f) |
constexpr bool | isInCheck () const |
void | setInCheck () |
void | clearInCheck () |
constexpr bool | isNonSilent () const |
void | setNonSilent () |
void | clearNonSilent () |
constexpr piece_t | getCapturedPiece () const |
void | setCapturedPiece (piece_t p) |
void | clearCapturedPiece () |
constexpr bool | whiteToMove () const |
constexpr bool | blackToMove () const |
constexpr int16_t | getMoveNumber () const |
constexpr side_t | getColourToMove () const |
constexpr bScore | minimizing () const |
constexpr piece_t | getPiece (case_t const cf) const |
constexpr piece_t | getPiece (column_t const iColumn, rank_t const iRank) const |
piece_t | getPieceCtl (column_t const iColumn, rank_t const iRank) const |
void | setPiece (case_t const cf, piece_t const piece) |
void | setPiece (case_t const cf, uint8_t const piece) |
piece_t | setGetPiece (column_t const newcol, rank_t const newrank, piece_t const piece) |
piece_t | removePiece (column_t const newcol, rank_t const newrank) |
void | clearPiece (case_t const cf) |
constexpr bool | isFieldEmpty (case_t const cf) const |
constexpr bool | isFieldEmpty (column_t const iColumn, rank_t const iRank) const |
constexpr case_t | getWhiteKingPos () const |
constexpr case_t | getBlackKingPos () const |
void | movePiece (case_t const cf, case_t const ct, piece_t const np) |
void | swapPiece (case_t const cf, piece_t const op, piece_t const np) |
void | clearPiece (case_t const cf, piece_t const op) |
void | restorePiece (case_t const cf, piece_t const op) |
void | moveWhiteKing (case_t const cf, case_t const ct) |
void | moveBlackKing (case_t const cf, case_t const ct) |
bFen | getFEN () const |
constexpr int8_t | pieceCount () const |
std::string | getHashStr () const |
constexpr hashkey_t | getHash () const |
void | setHash (hashkey_t const newHash) |
boardInfo_t | getBoardInfo () const |
void | setBoardInfo (boardInfo_t boardInfo) |
boardInfo_t | applyWhiteMove (bMove const &m) |
boardInfo_t | applyBlackMove (bMove const &m) |
void | unApplyMove (bMove const &m, boardInfo_t const oldBoardInfo) |
exact restoration of basic board using move details | |
boardInfo_t | makeBoardMove (column_t const oldcol, rank_t const oldrank, column_t const newcol, rank_t const newrank) |
apply move to check if in check only, board to be discarded as it will be in incomplete state, no hash update no check flag set, etc. | |
void | unMakeBoardMove (case_t const &cf, column_t const newcol, rank_t const newrank, boardInfo_t const oldBoardInfo) |
undo makeBoardMove, restoring previous situation | |
Friends | |
class | bPositionEvaluation |
class | PosEvalPositionalBoard |
class | bWhitePiece |
class | bBlackPiece |
std::ostream & | operator<< (std::ostream &os, bBoard const &dt) |
print board | |
Additional Inherited Members | |
![]() | |
bBasicBoard () | |
bBasicBoard (bBasicBoard &&bb) | |
bBasicBoard (bFen const &fen) | |
bBasicBoard & | operator= (bBasicBoard const &)=delete |
bBasicBoard & | operator= (bBasicBoard &&)=delete |
void | calcHash () |
Set hash based on board position, also calc pieces Byte 0: bits 4-6 capture count (masked) bit 7 player to move We are using 64 bits for hash. | |
void | capturePieceOn (piece_t const capturedPiece, case_t const ct) |
Clear castle flag if rook captured update piece counter, update hash, clear field. | |
void | setPieceKU (case_t const cf, piece_t const piece) |
void | setPieceCount (int8_t const n) |
void | incPieceCount () |
void | decPieceCount () |
|
explicit |
Copy board with limited board data, no board history.
Definition at line 20 of file board.cpp.
Referenced by bBlackPiece, bBoard(), bBoard(), operator<<, operator=(), operator=(), and setVariation().
|
explicit |
void bBoard::invertColours | ( | ) |
invert colours update kingpos, update colour to move, castle rights, ...
castledone, capturedcase, capturedpiece, bmove, eval
epcase
Definition at line 183 of file board.cpp.
Referenced by bel_debug::execute(), and cmd_eval::execute().
|
inlineconstexpr |
Definition at line 59 of file board.h.
Referenced by PosEvalPositionalBoard::getEvaluation(), PosEvalStaticBoard::getEvaluation(), and getGameStageName().
std::string bBoard::getGameStageName | ( | ) | const |
Definition at line 167 of file board.cpp.
Referenced by cmd_eval::execute(), and operator std::string().
void bBoard::calcGameStage | ( | ) |
calculate stage of game to assist in evaluation
Definition at line 139 of file board.cpp.
Referenced by bBoard(), bGame::playGameMove(), and bSearchAlgorithm::SearchBestMove().
|
inlineconstexpr |
Definition at line 69 of file board.h.
Referenced by calcGameStage(), and calcMinorPieces().
|
inline |
Definition at line 71 of file board.h.
Referenced by applyMove().
|
inline |
Definition at line 73 of file board.h.
Referenced by calcMinorPieces().
void bBoard::calcMinorPieces | ( | bool const | bForceRecalc = false | ) |
Recalculate minor pieces, used for evaluation and end of game condition in case of less than 5 pieces.
bForceRecalc | force to recalculate |
Definition at line 68 of file board.cpp.
Referenced by bBoard(), SearchAlphaBeta::CalcBestMove(), SearchAlphaBetaFH::CalcBestMove(), cmd_eval::execute(), invertColours(), SearchAlphaBeta::Quiescence(), and bSearchAlgorithm::SearchBestMove().
|
inline |
Definition at line 80 of file board.h.
Referenced by bGame::revertGameMove().
|
inline |
Definition at line 82 of file board.h.
Referenced by applyMove(), and bGame::playGameMove().
|
inline |
Definition at line 85 of file board.h.
Referenced by bBoard(), UCIMode::sendInfoSearching(), UCIMode::sendInfoSearching(), XboardMode::sendInfoSearching(), and setVariation().
|
inline |
Definition at line 87 of file board.h.
Referenced by bSearchAlgorithm::SearchBestMove().
|
inline |
Definition at line 89 of file board.h.
Referenced by UCIMode::sendInfoCurrMove(), UCIMode::sendInfoSearching(), UCIMode::sendInfoSearching(), XboardMode::sendInfoSearching(), and setVariation().
|
inline |
Definition at line 91 of file board.h.
Referenced by bSearchAlgorithm::SearchBestMove().
void bBoard::setVariation | ( | bBoard const & | chldbrd | ) |
Definition at line 227 of file board.cpp.
Referenced by SearchAlphaBeta::CalcBestMove(), and SearchAlphaBetaFH::CalcBestMove().
|
overridevirtual |
modification of board move is kept on previous board newboard does not have move stored and has flag to recalculate minor pieces
Reimplemented from bBasicBoard.
Definition at line 217 of file board.cpp.
Referenced by SearchAlphaBeta::CalcBestMove(), SearchAlphaBetaFH::CalcBestMove(), SearchEvalPosOnly::CalcBestMove(), bGame::playGameMove(), and SearchAlphaBeta::Quiescence().
bBoard::operator std::string | ( | ) | const |
|
friend |
Definition at line 100 of file board.h.
Referenced by bPositionEvaluation.
|
friend |
Definition at line 101 of file board.h.
Referenced by PosEvalPositionalBoard.
|
friend |
Definition at line 102 of file board.h.
Referenced by bWhitePiece.
|
friend |
Definition at line 103 of file board.h.
Referenced by bBlackPiece.