X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fposition.h;h=02e3a2452fd6382c05e1b0a714c69aa775056ff3;hb=95cfc0e3069e2bd573e37c42785a1d7b287295c2;hp=3fabf64c8156ddac239390d58fcb79bb10f81eb8;hpb=5f142ec2098531bac1780f67579dedbd12d18dcc;p=stockfish diff --git a/src/position.h b/src/position.h index 3fabf64c..02e3a245 100644 --- a/src/position.h +++ b/src/position.h @@ -74,17 +74,16 @@ enum CastleRights { /// The UndoInfo struct stores information we need to restore a Position -/// object to its previous state when we retract a move. Whenever a move +/// object to its previous state when we retract a move. Whenever a move /// is made on the board (by calling Position::do_move), an UndoInfo object -/// must be passed as a parameter. When the move is unmade (by calling +/// must be passed as a parameter. When the move is unmade (by calling /// Position::undo_move), the same UndoInfo object must be passed again. struct UndoInfo { - int castleRights; - Square epSquare; - Bitboard checkersBB, pinners[2], pinned[2], dcCandidates[2]; + Bitboard pinners[2], pinned[2], dcCandidates[2], checkersBB; Key key, pawnKey, materialKey; - int rule50; + int castleRights, rule50; + Square epSquare; Move lastMove; Value mgValue, egValue; PieceType capture; @@ -220,9 +219,7 @@ public: // Properties of moves bool pl_move_is_legal(Move m) const; - bool pl_move_is_legal(Move m, Bitboard pinned) const; bool move_is_check(Move m) const; - bool move_is_check(Move m, Bitboard dcCandidates) const; bool move_is_capture(Move m) const; bool move_is_deep_pawn_push(Move m) const; bool move_is_pawn_push_to_7th(Move m) const; @@ -246,7 +243,6 @@ public: void backup(UndoInfo &u) const; void restore(const UndoInfo &u); void do_move(Move m, UndoInfo &u); - void do_move(Move m, UndoInfo &u, Bitboard dcCandidates); void undo_move(Move m, const UndoInfo &u); void do_null_move(UndoInfo &u); void undo_null_move(const UndoInfo &u); @@ -329,8 +325,6 @@ private: // Bitboards Bitboard byColorBB[2], byTypeBB[8]; - Bitboard checkersBB; - mutable Bitboard pinners[2], pinned[2], dcCandidates[2]; // Board Piece board[64]; @@ -343,16 +337,21 @@ private: int index[64]; // Other info + Square kingSquare[2]; Color sideToMove; - int castleRights; + int gamePly; + Key history[MaxGameLength]; + Value npMaterial[2]; File initialKFile, initialKRFile, initialQRFile; + + // Info backed up in do_move() + mutable Bitboard pinners[2], pinned[2], dcCandidates[2]; + Bitboard checkersBB; + Key key, pawnKey, materialKey; + int castleRights, rule50; Square epSquare; - Square kingSquare[2]; Move lastMove; - Key key, pawnKey, materialKey, history[MaxGameLength]; - int rule50, gamePly; Value mgValue, egValue; - Value npMaterial[2]; // Static variables static int castleRightsMask[64];