]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Do not special case generate_king_moves()
[stockfish] / src / position.h
index 9acb29669e1633fe76159abcf5ea8241f4e3f8c8..5285c8f928afb0df26f1c50667e4131bad68eaa3 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();
@@ -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];
 }