]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Shortcut sorting when no move is in history
[stockfish] / src / position.h
index 9acb29669e1633fe76159abcf5ea8241f4e3f8c8..25596bf6a2add681047ef5085006cb3640782dff 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();
@@ -681,6 +682,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];
 }