X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmove.h;h=17ce8b430b25b933e9b4a39c996bc6816df57510;hb=afadc33fb430abd2ba2783a62180cf971b13652f;hp=e9f7242696c9abf0fa477758b192c47f4ace9dcb;hpb=c6c4713ab2fb19e542b13df3b48bd14313bc5ad7;p=stockfish diff --git a/src/move.h b/src/move.h index e9f72426..17ce8b43 100644 --- a/src/move.h +++ b/src/move.h @@ -62,6 +62,9 @@ struct MoveStack { int score; }; +// Note that operator< is set up such that std::sort() will sort in descending order +inline bool operator<(const MoveStack& f, const MoveStack& s) { return s.score < f.score; } + //// //// Inline functions @@ -79,12 +82,12 @@ inline PieceType move_promotion(Move m) { return PieceType((int(m) >> 12) & 7); } -inline bool move_is_ep(Move m) { - return bool((int(m) >> 15) & 1); +inline int move_is_ep(Move m) { + return m & (1 << 15); } -inline bool move_is_castle(Move m) { - return bool((int(m) >> 16) & 1); +inline int move_is_castle(Move m) { + return m & (1 << 16); } inline bool move_is_short_castle(Move m) {