]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Position::is_ok()give more info on failed test
[stockfish] / src / position.h
index 9acb29669e1633fe76159abcf5ea8241f4e3f8c8..ca233aa31d53d0dc70a715a35420164d345ea615 100644 (file)
@@ -278,6 +278,7 @@ public:
   Value eg_value() const;
   Value non_pawn_material(Color c) const;
   Phase game_phase() const;
+  Value mg_pst_delta(Move m) const;
 
   // Game termination checks
   bool is_mate();
@@ -297,7 +298,7 @@ public:
   void reset_game_ply();
   
   // Position consistency check, for debugging
-  bool is_ok() const;
+  bool is_ok(int* failedStep = NULL) const;
 
   // Static member functions:
   static void init_zobrist();
@@ -369,6 +370,10 @@ private:
 };
 
 
+/// An array of member functions to dispatch attacks_square
+typedef Bitboard (Position::* Piece_attacks_fn)(Square s) const;
+extern const Piece_attacks_fn piece_attacks_fn[];
+
 ////
 //// Inline functions
 ////
@@ -681,6 +686,11 @@ inline Value Position::mg_pst(Color c, PieceType pt, Square s) const {
   return MgPieceSquareTable[piece_of_color_and_type(c, pt)][s];
 }
 
+inline Value Position::mg_pst_delta(Move m) const {
+  return MgPieceSquareTable[piece_on(move_from(m))][move_to(m)]
+        -MgPieceSquareTable[piece_on(move_from(m))][move_from(m)];
+}
+
 inline Value Position::eg_pst(Color c, PieceType pt, Square s) const {
   return EgPieceSquareTable[piece_of_color_and_type(c, pt)][s];
 }