X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=25596bf6a2add681047ef5085006cb3640782dff;hp=9acb29669e1633fe76159abcf5ea8241f4e3f8c8;hb=a03ab94f4446f4b27fa7c1a764af4c5a22a42352;hpb=88bb3c9422191b2e8260eeb4d5186f5b4708520f diff --git a/src/position.h b/src/position.h index 9acb2966..25596bf6 100644 --- a/src/position.h +++ b/src/position.h @@ -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]; }