X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=ae750697aa894b423fa52e15f5fb4a7d8f93f0eb;hp=8d1ba3598c2da91c9252bbdf39efa3be3fea3fda;hb=da7a62852ab5e96d24bb4fd2f062d488684738b1;hpb=8f59de48f559e477dc383d5b51a0b842986758d0 diff --git a/src/position.h b/src/position.h index 8d1ba359..ae750697 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; }; @@ -294,6 +294,7 @@ private: void allow_ooo(Color c); // Helper functions for doing and undoing moves + void init_new_state(StateInfo& newSt); void do_capture_move(Move m, PieceType capture, Color them, Square to); void do_castle_move(Move m); void do_promotion_move(Move m); @@ -302,6 +303,7 @@ private: void undo_promotion_move(Move m); void undo_ep_move(Move m); void find_checkers(); + void find_pinned(); template void update_checkers(Bitboard* pCheckersBB, Square ksq, Square from, Square to, Bitboard dcCandidates); @@ -556,6 +558,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; }