]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Small update to pop_1st_bit()
[stockfish] / src / position.h
index 09c630062dd3984ea5a2fcc0ffaa647c7ff4fe2a..c04f1412e5db666ef0ac06f86395171f663abc66 100644 (file)
@@ -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;