/*1Stockfish, a UCI chess playing engine derived from Glaurung 2.12Copyright (C) 2004-2025 The Stockfish developers (see AUTHORS file)34Stockfish is free software: you can redistribute it and/or modify5it under the terms of the GNU General Public License as published by6the Free Software Foundation, either version 3 of the License, or7(at your option) any later version.89Stockfish is distributed in the hope that it will be useful,10but WITHOUT ANY WARRANTY; without even the implied warranty of11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12GNU General Public License for more details.1314You should have received a copy of the GNU General Public License15along with this program. If not, see <http://www.gnu.org/licenses/>.16*/1718#ifndef MOVEPICK_H_INCLUDED19#define MOVEPICK_H_INCLUDED2021#include "history.h"22#include "movegen.h"23#include "types.h"2425namespace Stockfish {2627class Position;2829// The MovePicker class is used to pick one pseudo-legal move at a time from the30// current position. The most important method is next_move(), which emits one31// new pseudo-legal move on every call, until there are no moves left, when32// Move::none() is returned. In order to improve the efficiency of the alpha-beta33// algorithm, MovePicker attempts to return the moves which are most likely to get34// a cut-off first.35class MovePicker {3637public:38MovePicker(const MovePicker&) = delete;39MovePicker& operator=(const MovePicker&) = delete;40MovePicker(const Position&,41Move,42Depth,43const ButterflyHistory*,44const LowPlyHistory*,45const CapturePieceToHistory*,46const PieceToHistory**,47const PawnHistory*,48int);49MovePicker(const Position&, Move, int, const CapturePieceToHistory*);50Move next_move();51void skip_quiet_moves();5253private:54template<typename Pred>55Move select(Pred);56template<GenType T>57ExtMove* score(MoveList<T>&);58ExtMove* begin() { return cur; }59ExtMove* end() { return endCur; }6061const Position& pos;62const ButterflyHistory* mainHistory;63const LowPlyHistory* lowPlyHistory;64const CapturePieceToHistory* captureHistory;65const PieceToHistory** continuationHistory;66const PawnHistory* pawnHistory;67Move ttMove;68ExtMove * cur, *endCur, *endBadCaptures, *endCaptures, *endGenerated;69int stage;70int threshold;71Depth depth;72int ply;73bool skipQuiets = false;74ExtMove moves[MAX_MOVES];75};7677} // namespace Stockfish7879#endif // #ifndef MOVEPICK_H_INCLUDED808182