X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fposition.h;h=11d31f8a80d17cb445f9d24e89bfd8f36393c0fd;hb=f9f30412e798b4ba06375a383a85a9e65bfe299f;hp=8d1ba3598c2da91c9252bbdf39efa3be3fea3fda;hpb=8f59de48f559e477dc383d5b51a0b842986758d0;p=stockfish diff --git a/src/position.h b/src/position.h index 8d1ba359..11d31f8a 100644 --- a/src/position.h +++ b/src/position.h @@ -83,10 +83,10 @@ struct StateInfo { Key key, pawnKey, materialKey; int castleRights, rule50; Square epSquare; - Move lastMove; Value mgValue, egValue; PieceType capture; StateInfo* previous; + Move lastMove; }; @@ -240,6 +240,7 @@ public: bool square_is_weak(Square s, Color c) const; // Doing and undoing moves + void setStartState(const StateInfo& st); void do_move(Move m, StateInfo& st); void undo_move(Move m); void do_null_move(StateInfo& st); @@ -302,6 +303,9 @@ private: void undo_promotion_move(Move m); void undo_ep_move(Move m); void find_checkers(); + void find_hidden_checks(Color us); + void find_hidden_checks(); + void update_hidden_checks(Square from, Square to); template void update_checkers(Bitboard* pCheckersBB, Square ksq, Square from, Square to, Bitboard dcCandidates); @@ -556,6 +560,19 @@ inline Bitboard Position::piece_attacks(Square s) const { return StepAttackBB[KING][s]; } +inline Bitboard Position::pinned_pieces(Color c) const { + return st->pinned[c]; +} + +inline Bitboard Position::pinned_pieces(Color c, Bitboard& p) const { + p = st->pinners[c]; + return st->pinned[c]; +} + +inline Bitboard Position::discovered_check_candidates(Color c) const { + return st->dcCandidates[c]; +} + inline Bitboard Position::checkers() const { return st->checkersBB; }