X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=c04f1412e5db666ef0ac06f86395171f663abc66;hp=e2365a68f306266bb1ec4ba84c09fab8762c15c2;hb=975d5e9c6444b3289cb8688d68d17ec9ed2a2285;hpb=dda7e4639aa19b91f2bafd2e8fb5b55c57eda97a diff --git a/src/position.h b/src/position.h index e2365a68..c04f1412 100644 --- a/src/position.h +++ b/src/position.h @@ -63,6 +63,18 @@ const int MaxGameLength = 220; //// Types //// +/// struct checkInfo is initialized at c'tor time and keeps +/// info used to detect if a move gives check. + +struct CheckInfo { + + CheckInfo(const Position&); + + Square ksq; + Bitboard dcCandidates; + Bitboard checkSq[8]; +}; + /// Castle rights, encoded as bit fields enum CastleRights { @@ -87,12 +99,13 @@ enum Phase { /// must be passed as a parameter. struct StateInfo { - Key key, pawnKey, materialKey; + Key pawnKey, materialKey; int castleRights, rule50, pliesFromNull; Square epSquare; Score value; Value npMaterial[2]; + Key key; PieceType capture; Bitboard checkersBB; StateInfo* previous; @@ -205,7 +218,7 @@ public: bool pl_move_is_legal(Move m, Bitboard pinned) const; bool pl_move_is_evasion(Move m, Bitboard pinned) const; bool move_is_check(Move m) const; - bool move_is_check(Move m, Bitboard dcCandidates) const; + bool move_is_check(Move m, const CheckInfo& ci) const; bool move_is_capture(Move m) const; bool move_is_capture_or_promotion(Move m) const; bool move_is_passed_pawn_push(Move m) const;