X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmovepick.h;h=cbb69a014dd83373193b6ef0eb68eff5f912a688;hb=f8bc38a00650c5f4c71aec6f6d5503c7ae4c17a3;hp=17f29daa93e353c83d955304e14388f43237eb64;hpb=310e07f29266f800ff9d9f24cb3f953d945fd32b;p=stockfish diff --git a/src/movepick.h b/src/movepick.h index 17f29daa..cbb69a01 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -1,13 +1,14 @@ /* - Glaurung, a UCI chess playing engine. - Copyright (C) 2004-2008 Tord Romstad - - Glaurung is free software: you can redistribute it and/or modify + Stockfish, a UCI chess playing engine derived from Glaurung 2.1 + Copyright (C) 2004-2008 Tord Romstad (Glaurung author) + Copyright (C) 2008 Marco Costalba + + Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - - Glaurung is distributed in the hope that it will be useful, + + Stockfish is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -61,11 +62,12 @@ public: MovePicker(Position &p, bool pvnode, Move ttm, Move mk, Move k1, Move k2, Depth dpth); - Move get_next_move(MovegenPhase* moveType = NULL); + Move get_next_move(); Move get_next_move(Lock &lock); int number_of_moves() const; int current_move_score() const; - Bitboard discovered_check_candidates(); + MovegenPhase current_move_type() const; + Bitboard discovered_check_candidates() const; static void init_phase_table(); @@ -93,11 +95,21 @@ private: //// Inline functions //// +/// MovePicker::number_of_moves() simply returns the numOfMoves member +/// variable. It is intended to be used in positions where the side to move +/// is in check, for detecting checkmates or situations where there is only +/// a single reply to check. + +inline int MovePicker::number_of_moves() const { + + return numOfMoves; +} + /// MovePicker::discovered_check_candidates() returns a bitboard containing /// all pieces which can possibly give discovered check. This bitboard is /// computed by the constructor function. -inline Bitboard MovePicker::discovered_check_candidates() { +inline Bitboard MovePicker::discovered_check_candidates() const { return dc; }