|
Belofte version 2.2.0
A promising chess program using the UCI or Winboard interface
|
#include <basicboard.h>
Inheritance diagram for bBasicBoard:Public Member Functions | |
| 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) |
| virtual boardInfo_t | applyMove (bMove const &m) |
| play game move on board | |
| 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 | |
Protected Member Functions | |
| bBasicBoard () | |
| bBasicBoard (bBasicBoard &&bb) | |
| bBasicBoard (bFen const &fen) | |
| bBasicBoard & | operator= (bBasicBoard const &bb) |
| 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 () |
Definition at line 53 of file basicboard.h.
|
protected |
Referenced by bBasicBoard(), bBasicBoard(), bBoard::bBoard(), bBoard::bBoard(), bBoard::bBoard(), operator=(), and operator=().
Here is the caller graph for this function:
|
inlineexplicitprotected |
|
explicitprotected |
Definition at line 17 of file basicboard.cpp.
Here is the call graph for this function:
|
inlineexplicit |
|
inlinevirtual |
Definition at line 77 of file basicboard.h.
|
inlineprotected |
Definition at line 62 of file basicboard.h.
Referenced by bBoard::operator=().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protecteddelete |
Here is the call graph for this function:
|
inlineconstexpr |
Definition at line 81 of file basicboard.h.
|
inline |
Definition at line 84 of file basicboard.h.
Referenced by bBasicBoard().
Here is the caller graph for this function:
|
inline |
Definition at line 86 of file basicboard.h.
Referenced by applyBlackMove(), applyWhiteMove(), bBasicBoard(), bBoard::invertColours(), and makeBoardMove().
Here is the caller graph for this function:
|
inline |
Definition at line 88 of file basicboard.h.
Referenced by bBoard::invertColours().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 95 of file basicboard.h.
Referenced by calcHash(), clearEp(), bBlackPawn::GenerateMoves(), bWhitePawn::GenerateMoves(), getFEN(), bBlackPawn::hasValidMovePreflightCheck(), bWhitePawn::hasValidMovePreflightCheck(), bBoard::operator std::string(), and setEp().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 97 of file basicboard.h.
Referenced by calcHash(), clearEp(), getFEN(), bBoard::operator std::string(), and setEp().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 99 of file basicboard.h.
Referenced by bBlackPawn::GenerateMoves(), bWhitePawn::GenerateMoves(), and getEp().
Here is the caller graph for this function:| void bBasicBoard::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
Definition at line 144 of file basicboard.cpp.
Referenced by applyBlackMove(), applyWhiteMove(), and bBasicBoard().
Here is the call graph for this function:
Here is the caller graph for this function:| void bBasicBoard::clearEp | ( | ) |
Definition at line 163 of file basicboard.cpp.
Referenced by applyBlackMove(), applyWhiteMove(), and bBasicBoard().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 109 of file basicboard.h.
Referenced by bPositionEvaluation::gameEndedResult(), and getFEN().
Here is the caller graph for this function:
|
inline |
Definition at line 111 of file basicboard.h.
Referenced by bBasicBoard().
Here is the caller graph for this function:
|
inline |
Definition at line 113 of file basicboard.h.
Referenced by applyBlackMove(), and applyWhiteMove().
Here is the caller graph for this function:
|
inline |
Definition at line 115 of file basicboard.h.
Referenced by applyBlackMove(), applyWhiteMove(), and capturePieceOn().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 119 of file basicboard.h.
Referenced by calcHash(), bBlackKing::GenerateMoves(), bWhiteKing::GenerateMoves(), getFEN(), and bBoard::invertColours().
Here is the caller graph for this function:
|
inline |
Definition at line 121 of file basicboard.h.
Referenced by applyWhiteMove().
Here is the caller graph for this function:
|
inline |
Definition at line 123 of file basicboard.h.
Referenced by applyBlackMove().
Here is the caller graph for this function:
|
inline |
Definition at line 125 of file basicboard.h.
|
inline |
Definition at line 127 of file basicboard.h.
|
inlineconstexpr |
Definition at line 129 of file basicboard.h.
|
inlineconstexpr |
Definition at line 131 of file basicboard.h.
| void bBasicBoard::setCastleRights | ( | uint8_t const | f | ) |
there can be (is) a difference in the offsets in the hash table and the castle flags
Definition at line 180 of file basicboard.cpp.
Referenced by bBasicBoard(), bBoard::invertColours(), and setCastleRights().
Here is the caller graph for this function:| void bBasicBoard::setCastleRights | ( | uint8_t const | f, |
| bool const | c ) |
| void bBasicBoard::clearCastleRights | ( | uint8_t const | f | ) |
there can be (is) a difference in the offsets in the hash table and the castle flags
Definition at line 190 of file basicboard.cpp.
Referenced by applyBlackMove(), applyWhiteMove(), capturePieceOn(), and setCastleRights().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 138 of file basicboard.h.
Referenced by SearchAlphaBeta::CalcBestMove(), bBoard::operator std::string(), and SearchAlphaBeta::Quiescence().
Here is the caller graph for this function:
|
inline |
Definition at line 140 of file basicboard.h.
Referenced by applyBlackMove(), and applyWhiteMove().
Here is the caller graph for this function:
|
inline |
Definition at line 142 of file basicboard.h.
Referenced by applyBlackMove(), and applyWhiteMove().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 145 of file basicboard.h.
Referenced by bBoard::operator std::string().
Here is the caller graph for this function:
|
inline |
Definition at line 147 of file basicboard.h.
Referenced by capturePieceOn().
Here is the caller graph for this function:
|
inline |
Definition at line 149 of file basicboard.h.
|
inlineconstexpr |
Definition at line 152 of file basicboard.h.
Referenced by bBoard::operator std::string(), and unApplyMove().
Here is the caller graph for this function:
|
inline |
Definition at line 154 of file basicboard.h.
Referenced by capturePieceOn().
Here is the caller graph for this function:
|
inline |
Definition at line 158 of file basicboard.h.
Referenced by applyBlackMove(), and applyWhiteMove().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 162 of file basicboard.h.
Referenced by cmd_usermove::execute(), bPositionEvaluation::gameEndedResult(), bBoard::invertColours(), minimizing(), bBoard::operator std::string(), and bSearchAlgorithm::SearchBestMove().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 164 of file basicboard.h.
Referenced by getEp().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 166 of file basicboard.h.
Referenced by getFEN(), and bBoard::operator std::string().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 168 of file basicboard.h.
Referenced by applyMove(), bMoveList::atLeastOneMovePossible(), calcHash(), bMoveList::generateMoves(), getFEN(), makeBoardMove(), unApplyMove(), and unMakeBoardMove().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 172 of file basicboard.h.
Referenced by SearchAlphaBeta::CalcBestMove(), SearchMiniMax::CalcBestMove(), bGame::EvalForPlayer(), cmd_eval::execute(), SearchAlphaBeta::Quiescence(), bSearchAlgorithm::RetrieveBoardEvaluation(), bSearchAlgorithm::SearchBestMove(), and bSearchAlgorithm::sendInfoSearching().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 178 of file basicboard.h.
Referenced by bBlackPawn::addCapturePawnMove(), bWhitePawn::addCapturePawnMove(), bBlackPawn::addCapturePromotionMove(), bWhitePawn::addCapturePromotionMove(), bBlackPiece::addMove(), bWhitePiece::addMove(), bBlackPiece::addMoves(), bWhitePiece::addMoves(), applyBlackMove(), applyWhiteMove(), bMoveList::atLeastOneMovePossible(), calcHash(), bBoard::calcMinorPieces(), bBlackPawn::canMovePreflightCheck(), bBlackPiece::canMovePreflightCheck(), bBlackPiece::canMovePreflightCheck(), bWhitePawn::canMovePreflightCheck(), bWhitePiece::canMovePreflightCheck(), bWhitePiece::canMovePreflightCheck(), bMoveList::generateMoves(), PosEvalStaticBoard::getEndgameEvaluation(), PosEvalPiecesOnly::getEvaluation(), getFEN(), PosEvalStaticBoard::getMatingEvaluation(), PosEvalStaticBoard::getPawnEndingEvaluation(), PosEvalStaticBoard::getRelativeBoardEval(), bBoard::invertColours(), bBlackPiece::isAttacked(), bWhitePiece::isAttacked(), bPieceColour::isAttackedBySlider(), makeBoardMove(), bBoard::operator std::string(), unApplyMove(), and unMakeBoardMove().
Here is the caller graph for this function:Definition at line 188 of file basicboard.h.
Referenced by bMoveList::addBlackPromotionIfValid(), bMoveList::addWhitePromotionIfValid(), makeBoardMove(), and unMakeBoardMove().
Here is the caller graph for this function:
|
inline |
Definition at line 190 of file basicboard.h.
|
inline |
Definition at line 192 of file basicboard.h.
Referenced by makeBoardMove().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 199 of file basicboard.h.
Referenced by makeBoardMove().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 205 of file basicboard.h.
Referenced by applyBlackMove(), applyWhiteMove(), makeBoardMove(), unApplyMove(), and unMakeBoardMove().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 207 of file basicboard.h.
Referenced by bBlackPiece::addMove(), bWhitePiece::addMove(), bBlackPiece::addMoves(), bWhitePiece::addMoves(), bBlackPawn::addNonCapturePawnMove(), bWhitePawn::addNonCapturePawnMove(), bBlackPawn::addNonCapturePromotionMove(), bWhitePawn::addNonCapturePromotionMove(), bBlackKing::GenerateMoves(), and bWhiteKing::GenerateMoves().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 212 of file basicboard.h.
Referenced by bMoveList::addBlackMoveIfValid(), bMoveList::addBlackPromotionIfValid(), bMoveList::addWhiteMoveIfValid(), bMoveList::addWhitePromotionIfValid(), bMoveList::atLeastOneMovePossible(), bWhitePawn::canMovePreflightCheck(), bWhitePiece::canMovePreflightCheck(), bWhitePiece::canMovePreflightCheck(), bPositionEvaluation::gameEndedResult(), and bBlackPiece::isAttacked().
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 214 of file basicboard.h.
Referenced by bMoveList::addBlackMoveIfValid(), bMoveList::addBlackPromotionIfValid(), bMoveList::addWhiteMoveIfValid(), bMoveList::addWhitePromotionIfValid(), bMoveList::atLeastOneMovePossible(), bBlackPawn::canMovePreflightCheck(), bBlackPiece::canMovePreflightCheck(), bBlackPiece::canMovePreflightCheck(), bPositionEvaluation::gameEndedResult(), and bWhitePiece::isAttacked().
Here is the caller graph for this function:Definition at line 225 of file basicboard.cpp.
Referenced by applyBlackMove(), applyWhiteMove(), and unApplyMove().
Here is the caller graph for this function:Definition at line 232 of file basicboard.cpp.
Referenced by applyBlackMove(), and applyWhiteMove().
Here is the caller graph for this function:Definition at line 238 of file basicboard.cpp.
Definition at line 244 of file basicboard.cpp.
Referenced by unApplyMove().
Here is the caller graph for this function:Definition at line 250 of file basicboard.cpp.
Referenced by applyWhiteMove().
Here is the caller graph for this function:Definition at line 258 of file basicboard.cpp.
Referenced by applyBlackMove().
Here is the caller graph for this function:| bFen bBasicBoard::getFEN | ( | ) | const |
Definition at line 97 of file basicboard.cpp.
Referenced by bel_debug::execute().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 227 of file basicboard.h.
Referenced by bBoard::calcGameStage(), and calcHash().
Here is the caller graph for this function:| std::string bBasicBoard::getHashStr | ( | ) | const |
Definition at line 698 of file basicboard.cpp.
|
inlineconstexpr |
Definition at line 231 of file basicboard.h.
|
inline |
Definition at line 233 of file basicboard.h.
|
inline |
Definition at line 237 of file basicboard.h.
|
inline |
Definition at line 239 of file basicboard.h.
|
virtual |
play game move on board
Reimplemented in bBoard.
Definition at line 314 of file basicboard.cpp.
Referenced by bBoard::applyMove().
Here is the call graph for this function:
Here is the caller graph for this function:| boardInfo_t bBasicBoard::applyWhiteMove | ( | bMove const & | m | ) |
Definition at line 324 of file basicboard.cpp.
Referenced by bMoveList::addWhiteMoveIfValid(), bMoveList::addWhitePromotionIfValid(), applyMove(), and bWhitePiece::canMovePreflightCheck().
Here is the call graph for this function:
Here is the caller graph for this function:| boardInfo_t bBasicBoard::applyBlackMove | ( | bMove const & | m | ) |
Definition at line 407 of file basicboard.cpp.
Referenced by bMoveList::addBlackMoveIfValid(), bMoveList::addBlackPromotionIfValid(), applyMove(), and bBlackPiece::canMovePreflightCheck().
Here is the call graph for this function:
Here is the caller graph for this function:| void bBasicBoard::unApplyMove | ( | bMove const & | m, |
| boardInfo_t const | oldBoardInfo ) |
exact restoration of basic board using move details
Definition at line 493 of file basicboard.cpp.
Referenced by bBlackPiece::canMovePreflightCheck(), bWhitePiece::canMovePreflightCheck(), and SearchAlphaBeta::Quiescence().
Here is the call graph for this function:
Here is the caller graph for this function:| boardInfo_t bBasicBoard::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.
promotion is not executed, pawn is kept at promotion place
| oldcol | column from |
| oldrank | rank from |
| newcol | column to |
| newrank | rank to |
Definition at line 568 of file basicboard.cpp.
Referenced by bBlackPawn::canMovePreflightCheck(), bBlackPiece::canMovePreflightCheck(), bWhitePawn::canMovePreflightCheck(), and bWhitePiece::canMovePreflightCheck().
Here is the call graph for this function:
Here is the caller graph for this function:| void bBasicBoard::unMakeBoardMove | ( | case_t const & | cf, |
| column_t const | newcol, | ||
| rank_t const | newrank, | ||
| boardInfo_t const | oldBoardInfo ) |
undo makeBoardMove, restoring previous situation
| cf | case from |
| newcol | column to |
| newrank | rank to |
| oldBoardInfo | the boardInfo of the old position Note: does not undo promotion properly |
Definition at line 641 of file basicboard.cpp.
Referenced by bBlackPawn::canMovePreflightCheck(), bBlackPiece::canMovePreflightCheck(), bWhitePawn::canMovePreflightCheck(), and bWhitePiece::canMovePreflightCheck().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
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.
Definition at line 275 of file basicboard.cpp.
Referenced by bBasicBoard(), and bBoard::invertColours().
Here is the call graph for this function:
Here is the caller graph for this function:Clear castle flag if rook captured update piece counter, update hash, clear field.
Definition at line 204 of file basicboard.cpp.
Referenced by applyBlackMove(), and applyWhiteMove().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 259 of file basicboard.h.
Referenced by bBasicBoard(), and bBoard::invertColours().
Here is the caller graph for this function:
|
inlineprotected |
Definition at line 267 of file basicboard.h.
Referenced by calcHash().
Here is the caller graph for this function:
|
inlineprotected |
Definition at line 269 of file basicboard.h.
Referenced by calcHash().
Here is the caller graph for this function:
|
inlineprotected |
Definition at line 271 of file basicboard.h.
Referenced by capturePieceOn().
Here is the caller graph for this function: