]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Introduce CheckInfo struct
[stockfish] / src / position.h
index e2365a68f306266bb1ec4ba84c09fab8762c15c2..9e476722955a3f012bbf9c6f67a867db41d3078e 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 dc;
+    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;