8#if !defined(MOVELIST_H)
35 {
return static_cast<movenum_t>(m_lmoves.size()); }
37 {
return m_nQSMoves; }
40 {
return m_lmoves[moveid - 1]; }
42 {
return m_lmoves[moveid - 1].getFromTo(); }
44 {
return m_lmoves[moveid - 1].getBMoveT(); }
53 {
for (
bMove& m: m_lmoves) m.clearScore(); }
60 {
return m_lmoves[m_bestmoveid - 1].getScore(); }
64 { m_lmoves[moveid - 1].setScore(score); }
67 {
return m_bestmoveid; }
84 {
return flags & 0x01; }
90 {
return flags & 0x02; }
92 {
return !(flags & 0x02); }
100 {
return flags & 0x04; }
104 { flags &= ~(0x04); }
112 { flags &= ~(0x08); }
115 {
return !(flags & 0x10); }
117 {
return flags & 0x10; }
119 {
return !(flags & 0x20); }
121 {
return flags & 0x20; }
126 inline bool bestMoveHasImproved(
bScore const score)
const
129 void addMoveToList(bBasicBoard
const& b, bMove& m,
bool const isCheckMove);
constexpr bool isGenerated() const
movenum_t generateMoves(bBasicBoard const &b)
generate moves if not yet generated
void setScoreOfMoveUnsorted(movenum_t const moveid, bScore const score)
Store score of move and update best move.
bMoveList & operator=(bMoveList const &ml)=delete
void setBestMoveScore(movenum_t const moveid, bScore const score)
constexpr bScore getBestMoveScore() const
bMoveList & operator=(bMoveList &&ml)=delete
constexpr bool isNoKeepScores() const
constexpr bool isKeepScores() const
movenum_t addBlackMoveIfValid(bBasicBoard const &b, bMove &m)
Only add move to movelist if valid.
constexpr bool isNoNeedSorted() const
void sortMoves()
sort moves and update bestmove id if less than 5 moves, sort all if more than 5 moves,...
void setMoveScore(movenum_t const moveid, bScore const score)
bool setScoreOfMove(movenum_t const moveid, bScore const score)
Store score of move and update best move.
movenum_t addBlackPromotionIfValid(bBasicBoard const &b, bMove &m)
Only add move to movelist if valid.
constexpr fromto_t getFromTo(movenum_t const moveid) const
void clearIsPossibleMove()
bMoveList(bMoveList &&ml)=delete
constexpr bmove_t getBMoveT(movenum_t const moveid) const
constexpr movenum_t getBestMoveId() const
constexpr bool isPossibleMove() const
constexpr bool isOnlyMove() const
friend std::ostream & operator<<(std::ostream &os, bMoveList const &ml)
bMoveList(bMoveList const &ml)=delete
constexpr bool isNotSorted() const
movenum_t addWhiteMoveIfValid(bBasicBoard const &b, bMove &m)
Only add move to movelist if valid.
constexpr movenum_t getNumberOfMoves() const
bool atLeastOneMovePossible(bBasicBoard &b)
see if at least one move can be played e.g.
constexpr movenum_t getNumberOfQSMoves() const
void setBestMoveId(movenum_t const n)
movenum_t adjustQSMoves()
reduce the number of QS moves to filter out the best ones only
constexpr bool isNeedSorted() const
bMove const & operator[](movenum_t const moveid) const
constexpr bool isSorted() const
movenum_t addWhitePromotionIfValid(bBasicBoard const &b, bMove &m)
Only add move to movelist if valid.
constexpr bScore realScore() const
std::vector< bMove > movelist_t