X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=c04f1412e5db666ef0ac06f86395171f663abc66;hp=09c630062dd3984ea5a2fcc0ffaa647c7ff4fe2a;hb=975d5e9c6444b3289cb8688d68d17ec9ed2a2285;hpb=f35ddb04af2a00bd9facf5b66ec97e4ab28d4480 diff --git a/src/position.h b/src/position.h index 09c63006..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 { @@ -206,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;