]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Retire move_attacks_square()
[stockfish] / src / position.h
index fced8e0c974c8a50c1921954ca62e1177975af46..d09dce08c22a6f9fe93772cbee22b733bb13daf7 100644 (file)
@@ -21,6 +21,7 @@
 #define POSITION_H_INCLUDED
 
 #include <cassert>
+#include <cstddef>
 
 #include "bitboard.h"
 #include "types.h"
@@ -44,7 +45,7 @@ struct CheckInfo {
 
 /// The StateInfo struct stores information we need to restore a Position
 /// object to its previous state when we retract a move. Whenever a move
-/// is made on the board (by calling Position::do_move), an StateInfo object
+/// is made on the board (by calling Position::do_move), a StateInfo object
 /// must be passed as a parameter.
 
 struct StateInfo {
@@ -60,13 +61,10 @@ struct StateInfo {
   StateInfo* previous;
 };
 
-struct ReducedStateInfo {
-  Key pawnKey, materialKey;
-  Value npMaterial[COLOR_NB];
-  int castleRights, rule50, pliesFromNull;
-  Score psqScore;
-  Square epSquare;
-};
+
+/// When making a move the current StateInfo up to 'key' excluded is copied to
+/// the new one. Here we calculate the quad words (64bits) needed to be copied.
+const size_t StateCopySize64 = offsetof(StateInfo, key) / sizeof(uint64_t) + 1;
 
 
 /// The position data structure. A position consists of the following data:
@@ -139,7 +137,6 @@ public:
 
   // Properties of moves
   bool move_gives_check(Move m, const CheckInfo& ci) const;
-  bool move_attacks_square(Move m, Square s) const;
   bool move_is_legal(const Move m) const;
   bool pl_move_is_legal(Move m, Bitboard pinned) const;
   bool is_pseudo_legal(const Move m) const;
@@ -183,7 +180,7 @@ public:
   Thread* this_thread() const;
   int64_t nodes_searched() const;
   void set_nodes_searched(int64_t n);
-  template<bool SkipRepetition> bool is_draw() const;
+  template<bool CheckRepetition, bool CheckThreeFold> bool is_draw() const;
 
   // Position consistency check, for debugging
   bool pos_is_ok(int* failedStep = NULL) const;