X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=a149bddb1bf59033134f52ca355e67cfdf349340;hp=d0087c3ba1c61968242de69b2d0858ea256fe179;hb=9c7e2c8f9d3eba45c20529ad0624e6de10fc7b83;hpb=b9bc6e823f061753419e563c4f923e60bd8c6193 diff --git a/src/position.h b/src/position.h index d0087c3b..a149bddb 100644 --- a/src/position.h +++ b/src/position.h @@ -60,6 +60,14 @@ struct StateInfo { StateInfo* previous; }; +struct ReducedStateInfo { + Key pawnKey, materialKey; + Value npMaterial[2]; + int castleRights, rule50, pliesFromNull; + Score psqScore; + Square epSquare; +}; + /// The position data structure. A position consists of the following data: /// @@ -133,6 +141,7 @@ public: // Properties of moves bool move_gives_check(Move m, const CheckInfo& ci) const; bool move_attacks_square(Move m, Square s) const; + bool move_is_legal(const Move m) const; bool pl_move_is_legal(Move m, Bitboard pinned) const; bool is_pseudo_legal(const Move m) const; bool is_capture(Move m) const; @@ -189,7 +198,6 @@ private: void clear(); void put_piece(Piece p, Square s); void set_castle_right(Color c, Square rfrom); - bool move_is_legal(const Move m) const; // Helper template functions template void do_castle_move(Move m); @@ -302,7 +310,7 @@ inline int Position::can_castle(CastleRight f) const { } inline int Position::can_castle(Color c) const { - return st->castleRights & ((WHITE_OO | WHITE_OOO) << c); + return st->castleRights & ((WHITE_OO | WHITE_OOO) << (2 * c)); } inline bool Position::castle_impeded(Color c, CastlingSide s) const {