Belofte version 2.1.9
A promising chess program using the UCI or Winboard interface
|
#include <movelist.h>
Public Member Functions | |
bMoveList () | |
~bMoveList () | |
bMoveList (bMoveList const &ml)=delete | |
bMoveList (bMoveList &&ml)=delete | |
bMoveList & | operator= (bMoveList const &ml)=delete |
bMoveList & | operator= (bMoveList &&ml)=delete |
movenum_t | adjustQSMoves () |
reduce the number of QS moves to filter out the best ones only | |
bool | atLeastOneMovePossible (bBasicBoard &b) |
see if at least one move can be played e.g. | |
movenum_t | generateMoves (bBasicBoard const &b) |
generate moves if not yet generated | |
void | emptyMoveList () |
constexpr movenum_t | getNumberOfMoves () const |
constexpr movenum_t | getNumberOfQSMoves () const |
bMove const & | operator[] (movenum_t const moveid) const |
constexpr fromto_t | getFromTo (movenum_t const moveid) const |
constexpr bmove_t | getBMoveT (movenum_t const moveid) const |
movenum_t | addWhiteMoveIfValid (bBasicBoard const &b, bMove &m) |
Only add move to movelist if valid. | |
movenum_t | addBlackMoveIfValid (bBasicBoard const &b, bMove &m) |
Only add move to movelist if valid. | |
movenum_t | addWhitePromotionIfValid (bBasicBoard const &b, bMove &m) |
Only add move to movelist if valid. | |
movenum_t | addBlackPromotionIfValid (bBasicBoard const &b, bMove &m) |
Only add move to movelist if valid. | |
void | sortMoves () |
sort moves and update bestmove id if less than 5 moves, sort all if more than 5 moves, and less than 3 qs moves, sort 3 best if more than 5 moves and at least 3 qs moves, sort qsmoves + 1 | |
void | clearScores () |
bool | setScoreOfMove (movenum_t const moveid, bScore const score) |
Store score of move and update best move. | |
void | setScoreOfMoveUnsorted (movenum_t const moveid, bScore const score) |
Store score of move and update best move. | |
constexpr bScore | getBestMoveScore () const |
void | setBestMoveScore (movenum_t const moveid, bScore const score) |
void | setMoveScore (movenum_t const moveid, bScore const score) |
constexpr movenum_t | getBestMoveId () const |
void | setBestMoveId (movenum_t const n) |
void | clearBestMoveId () |
void | setNeedSorted () |
void | clearNeedSorted () |
void | setKeepScores () |
void | clearKeepScores () |
Protected Member Functions | |
constexpr bool | isGenerated () const |
void | setIsGenerated () |
void | clearIsGenerated () |
constexpr bool | isSorted () const |
constexpr bool | isNotSorted () const |
void | setIsSorted () |
void | clearIsSorted () |
constexpr bool | isOnlyMove () const |
void | setIsOnlyMove () |
void | clearIsOnlyMove () |
constexpr bool | isPossibleMove () const |
void | setIsPossibleMove () |
void | clearIsPossibleMove () |
constexpr bool | isNeedSorted () const |
constexpr bool | isNoNeedSorted () const |
constexpr bool | isKeepScores () const |
constexpr bool | isNoKeepScores () const |
Friends | |
std::ostream & | operator<< (std::ostream &os, bMoveList const &ml) |
Definition at line 15 of file movelist.h.
|
inlineexplicit |
Definition at line 17 of file movelist.h.
Referenced by bMoveList(), bMoveList(), operator<<, operator=(), and operator=().
|
inline |
Definition at line 20 of file movelist.h.
|
delete |
|
delete |
movenum_t bMoveList::adjustQSMoves | ( | ) |
reduce the number of QS moves to filter out the best ones only
Definition at line 383 of file movelist.cpp.
bool bMoveList::atLeastOneMovePossible | ( | bBasicBoard & | b | ) |
see if at least one move can be played e.g.
(stale-)mate eval called from addMoveToList, iterative search main loop and gameEndedResult
Definition at line 404 of file movelist.cpp.
Referenced by bPositionEvaluation::gameEndedResult(), and bSearchAlgorithm::SearchBestMove().
movenum_t bMoveList::generateMoves | ( | bBasicBoard const & | b | ) |
generate moves if not yet generated
Definition at line 340 of file movelist.cpp.
Referenced by bPgnMove::bPgnMove(), bPgnMoveList::bPgnMoveList(), SearchAlphaBeta::CalcBestMove(), SearchAlphaBetaFH::CalcBestMove(), SearchRandom::CalcBestMove(), bel_debug::execute(), bGame::playGameMove(), and SearchAlphaBeta::Quiescence().
void bMoveList::emptyMoveList | ( | ) |
Definition at line 370 of file movelist.cpp.
Referenced by SearchRandom::CalcBestMove().
|
inlineconstexpr |
Definition at line 34 of file movelist.h.
Referenced by bPgnMove::bPgnMove(), SearchEvalPosOnly::CalcBestMove(), generateMoves(), operator<<, and bGame::playGameMove().
|
inlineconstexpr |
Definition at line 36 of file movelist.h.
Referenced by operator<<, and SearchAlphaBeta::Quiescence().
Definition at line 39 of file movelist.h.
Definition at line 41 of file movelist.h.
Definition at line 43 of file movelist.h.
movenum_t bMoveList::addWhiteMoveIfValid | ( | bBasicBoard const & | b, |
bMove & | m ) |
Only add move to movelist if valid.
b | board on which move is calculated |
m | move to be added |
Definition at line 177 of file movelist.cpp.
Referenced by bWhitePawn::addCapturePawnMove(), bWhitePawn::addEPMove(), bWhitePiece::addMove(), bWhitePiece::addMoves(), bWhitePawn::addNonCapturePawnMove(), and bWhiteKing::GenerateMoves().
movenum_t bMoveList::addBlackMoveIfValid | ( | bBasicBoard const & | b, |
bMove & | m ) |
Only add move to movelist if valid.
b | board on which move is calculated |
m | move to be added |
Definition at line 193 of file movelist.cpp.
Referenced by bBlackPawn::addCapturePawnMove(), bBlackPawn::addEPMove(), bBlackPiece::addMove(), bBlackPiece::addMoves(), bBlackPawn::addNonCapturePawnMove(), and bBlackKing::GenerateMoves().
movenum_t bMoveList::addWhitePromotionIfValid | ( | bBasicBoard const & | b, |
bMove & | m ) |
Only add move to movelist if valid.
b | board on which move is calculated |
m | move to be added |
Definition at line 209 of file movelist.cpp.
Referenced by bWhitePawn::addCapturePromotionMove(), and bWhitePawn::addNonCapturePromotionMove().
movenum_t bMoveList::addBlackPromotionIfValid | ( | bBasicBoard const & | b, |
bMove & | m ) |
Only add move to movelist if valid.
b | board on which move is calculated |
m | move to be added |
Definition at line 250 of file movelist.cpp.
Referenced by bBlackPawn::addCapturePromotionMove(), and bBlackPawn::addNonCapturePromotionMove().
void bMoveList::sortMoves | ( | ) |
sort moves and update bestmove id if less than 5 moves, sort all if more than 5 moves, and less than 3 qs moves, sort 3 best if more than 5 moves and at least 3 qs moves, sort qsmoves + 1
Definition at line 293 of file movelist.cpp.
Referenced by SearchAlphaBeta::CalcBestMove(), SearchAlphaBetaFH::CalcBestMove(), bel_debug::execute(), and SearchAlphaBeta::Quiescence().
|
inline |
Definition at line 52 of file movelist.h.
Referenced by SearchAlphaBeta::CalcBestMove(), SearchEvalPosOnly::CalcBestMove(), SearchRandom::CalcBestMove(), and SearchAlphaBeta::Quiescence().
Store score of move and update best move.
moveid | of move to be stored [1 -> max number of moves] |
score | to be stored |
Definition at line 130 of file movelist.cpp.
Referenced by SearchAlphaBeta::CalcBestMove(), SearchAlphaBetaFH::CalcBestMove(), SearchEvalPosOnly::CalcBestMove(), and SearchAlphaBeta::Quiescence().
Store score of move and update best move.
moveid | of move to be stored [1 -> max number of moves] |
score | to be stored |
Definition at line 156 of file movelist.cpp.
Referenced by SearchRandom::CalcBestMove().
|
inlineconstexpr |
Definition at line 59 of file movelist.h.
Definition at line 61 of file movelist.h.
Referenced by SearchAlphaBeta::Quiescence(), setScoreOfMove(), and setScoreOfMoveUnsorted().
Definition at line 63 of file movelist.h.
Referenced by setBestMoveScore(), setScoreOfMove(), and setScoreOfMoveUnsorted().
|
inlineconstexpr |
Definition at line 66 of file movelist.h.
Referenced by bGame::getEpdMoveInPosition(), isPossibleMove(), setScoreOfMove(), setScoreOfMoveUnsorted(), and bGame::WaitForSearchEnd().
|
inline |
Definition at line 68 of file movelist.h.
Referenced by sortMoves().
|
inline |
Definition at line 70 of file movelist.h.
Referenced by emptyMoveList(), and sortMoves().
|
inline |
Definition at line 73 of file movelist.h.
|
inline |
Definition at line 75 of file movelist.h.
Referenced by SearchRandom::CalcBestMove(), and bGame::playGameMove().
|
inline |
Definition at line 77 of file movelist.h.
|
inline |
Definition at line 79 of file movelist.h.
Referenced by SearchRandom::CalcBestMove(), and bGame::playGameMove().
|
inlineconstexprprotected |
Definition at line 83 of file movelist.h.
Referenced by generateMoves().
|
inlineprotected |
Definition at line 85 of file movelist.h.
Referenced by generateMoves().
|
inlineprotected |
Definition at line 87 of file movelist.h.
Referenced by emptyMoveList().
|
inlineconstexprprotected |
Definition at line 89 of file movelist.h.
Referenced by adjustQSMoves().
|
inlineconstexprprotected |
Definition at line 91 of file movelist.h.
Referenced by sortMoves().
|
inlineprotected |
Definition at line 93 of file movelist.h.
Referenced by emptyMoveList(), setScoreOfMove(), and sortMoves().
|
inlineprotected |
Definition at line 95 of file movelist.h.
Referenced by setScoreOfMove().
|
inlineconstexprprotected |
Definition at line 99 of file movelist.h.
|
inlineprotected |
Definition at line 101 of file movelist.h.
Referenced by sortMoves().
|
inlineprotected |
Definition at line 103 of file movelist.h.
Referenced by sortMoves().
|
inlineconstexprprotected |
Definition at line 107 of file movelist.h.
Referenced by atLeastOneMovePossible().
|
inlineprotected |
Definition at line 109 of file movelist.h.
Referenced by atLeastOneMovePossible(), and generateMoves().
|
inlineprotected |
Definition at line 111 of file movelist.h.
Referenced by emptyMoveList().
|
inlineconstexprprotected |
Definition at line 114 of file movelist.h.
Referenced by setScoreOfMove(), and sortMoves().
|
inlineconstexprprotected |
Definition at line 116 of file movelist.h.
|
inlineconstexprprotected |
Definition at line 118 of file movelist.h.
|
inlineconstexprprotected |
Definition at line 120 of file movelist.h.
|
friend |
Definition at line 435 of file movelist.cpp.