- MovePicker& operator=(const MovePicker&); // Silence a warning under MSVC
-
-public:
- MovePicker(const Position&, Move, Depth, const HistoryStats&, Square);
- MovePicker(const Position&, Move, const HistoryStats&, PieceType);
- MovePicker(const Position&, Move, Depth, const HistoryStats&, Move*, Search::Stack*);
- ~MovePicker();
-
- template<bool SpNode> Move next_move();
-
-private:
- template<GenType> void score();
- void generate_next();
-
- const Position& pos;
- const HistoryStats& history;
- Search::Stack* ss;
- Move* countermoves;
- Depth depth;
- Move ttMove;
- ExtMove killers[4];
- Square recaptureSquare;
- int captureThreshold, stage;
- ExtMove *moves, *cur, *end, *endQuiets, *endBadCaptures;
+ enum PickType {
+ Next,
+ Best
+ };
+
+ public:
+ MovePicker(const MovePicker&) = delete;
+ MovePicker& operator=(const MovePicker&) = delete;
+ MovePicker(const Position&,
+ Move,
+ Depth,
+ const ButterflyHistory*,
+ const CapturePieceToHistory*,
+ const PieceToHistory**,
+ Move,
+ const Move*);
+ MovePicker(const Position&,
+ Move,
+ Depth,
+ const ButterflyHistory*,
+ const CapturePieceToHistory*,
+ const PieceToHistory**,
+ Square);
+ MovePicker(const Position&, Move, Value, const CapturePieceToHistory*);
+ Move next_move(bool skipQuiets = false);
+
+ private:
+ template<PickType T, typename Pred>
+ Move select(Pred);
+ template<GenType>
+ void score();
+ ExtMove* begin() { return cur; }
+ ExtMove* end() { return endMoves; }
+
+ const Position& pos;
+ const ButterflyHistory* mainHistory;
+ const CapturePieceToHistory* captureHistory;
+ const PieceToHistory** continuationHistory;
+ Move ttMove;
+ ExtMove refutations[3], *cur, *endMoves, *endBadCaptures;
+ int stage;
+ Square recaptureSquare;
+ Value threshold;
+ Depth depth;
+ ExtMove moves[MAX_MOVES];