+private:
+ Value table[COLOR_NB][SQUARE_NB][SQUARE_NB];
+};
+
+/// MovePicker class is used to pick one pseudo legal move at a time from the
+/// current position. The most important method is next_move(), which returns a
+/// new pseudo legal move each time it is called, until there are no moves left,
+/// when MOVE_NONE is returned. In order to improve the efficiency of the alpha
+/// beta algorithm, MovePicker attempts to return the moves which are most likely
+/// to get a cut-off first.
+
+class MovePicker {
+public:
+ MovePicker(const MovePicker&) = delete;
+ MovePicker& operator=(const MovePicker&) = delete;
+
+ MovePicker(const Position&, Move, Value);
+ MovePicker(const Position&, Move, Depth, Square);
+ MovePicker(const Position&, Move, Depth, Search::Stack*);
+
+ Move next_move();
+
+private:
+ template<GenType> void score();
+ void generate_next_stage();
+ ExtMove* begin() { return moves; }
+ ExtMove* end() { return endMoves; }
+
+ const Position& pos;
+ const Search::Stack* ss;
+ Move countermove;
+ Depth depth;
+ Move ttMove;
+ ExtMove killers[3];
+ Square recaptureSquare;
+ Value threshold;
+ int stage;
+ ExtMove* endBadCaptures = moves + MAX_MOVES - 1;
+ ExtMove moves[MAX_MOVES], *cur = moves, *endMoves = moves;
+};