]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Retire States global variable
[stockfish] / src / position.h
index 25e57512cd18720345b7f04fd73fe80e73a2fa8a..fa812effff71584c94db59aad1019f51868ee599 100644 (file)
@@ -56,7 +56,10 @@ struct StateInfo {
   Bitboard   checkSquares[PIECE_TYPE_NB];
 };
 
-// In a std::deque references to elements are unaffected upon resizing
+/// A list to keep track of the position states along the setup moves (from the
+/// start position to the position just before the search starts). Needed by
+/// 'draw by repetition' detection. Use a std::deque because pointers to
+/// elements are not invalidated upon list resizing.
 typedef std::unique_ptr<std::deque<StateInfo>> StateListPtr;
 
 
@@ -134,11 +137,9 @@ public:
   void undo_move(Move m);
   void do_null_move(StateInfo& newSt);
   void undo_null_move();
-  void increment_nodes();
-  void increment_tbHits();
 
   // Static Exchange Evaluation
-  bool see_ge(Move m, Value value = VALUE_ZERO) const;
+  bool see_ge(Move m, Value threshold = VALUE_ZERO) const;
 
   // Accessing hash keys
   Key key() const;
@@ -148,12 +149,9 @@ public:
 
   // Other properties of the position
   Color side_to_move() const;
-  Phase game_phase() const;
   int game_ply() const;
   bool is_chess960() const;
   Thread* this_thread() const;
-  uint64_t nodes_searched() const;
-  uint64_t tb_hits() const;
   bool is_draw(int ply) const;
   int rule50_count() const;
   Score psq_score() const;
@@ -161,7 +159,7 @@ public:
   Value non_pawn_material() const;
 
   // Position consistency check, for debugging
-  bool pos_is_ok(int* failedStep = nullptr) const;
+  bool pos_is_ok() const;
   void flip();
 
 private:
@@ -187,8 +185,6 @@ private:
   int castlingRightsMask[SQUARE_NB];
   Square castlingRookSquare[CASTLING_RIGHT_NB];
   Bitboard castlingPath[CASTLING_RIGHT_NB];
-  uint64_t nodes;
-  uint64_t tbHits;
   int gamePly;
   Color sideToMove;
   Thread* thisThread;
@@ -353,22 +349,6 @@ inline int Position::rule50_count() const {
   return st->rule50;
 }
 
-inline uint64_t Position::nodes_searched() const {
-  return nodes;
-}
-
-inline void Position::increment_nodes() {
-  nodes++;
-}
-
-inline uint64_t Position::tb_hits() const {
-  return tbHits;
-}
-
-inline void Position::increment_tbHits() {
-  tbHits++;
-}
-
 inline bool Position::opposite_bishops() const {
   return   pieceCount[W_BISHOP] == 1
         && pieceCount[B_BISHOP] == 1