]> git.sesse.net Git - stockfish/commitdiff
Introduce captured_piece()
authorMarco Costalba <mcostalba@gmail.com>
Mon, 8 Mar 2010 13:57:01 +0000 (14:57 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 13 Mar 2010 10:07:10 +0000 (11:07 +0100)
It will be used by future patches and also rearranges some
half cooked code that mistakenly ended up in master in the
past.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/position.cpp
src/position.h

index 0336a832a363291d4c07d5ade63899db790a9bca..f24c2f2c0c3d72c1bb332b5589bdc71f6edd0781 100644 (file)
@@ -1301,11 +1301,6 @@ void Position::undo_null_move() {
 }
 
 
-///
-PieceType Position::captured_piece() const {
-  return st->capture;
-}
-
 /// Position::see() is a static exchange evaluator: It tries to estimate the
 /// material gain or loss resulting from a move. There are three versions of
 /// this function: One which takes a destination square as input, one takes a
index 591107e4b2ddd6e2d1d310680ce7ee199261d6db..d92ed1caf4c4067f479407a31c6bc07ceba7206e 100644 (file)
@@ -224,6 +224,9 @@ public:
   bool move_is_passed_pawn_push(Move m) const;
   bool move_attacks_square(Move m, Square s) const;
 
+  // Piece captured with previous moves
+  PieceType captured_piece() const;
+
   // Information about pawns
   bool pawn_is_passed(Color c, Square s) const;
   static bool pawn_is_passed(Bitboard theirPawns, Color c, Square s);
@@ -241,9 +244,6 @@ public:
   void do_null_move(StateInfo& st);
   void undo_null_move();
 
-  // Past
-  PieceType captured_piece() const;
-
   // Static exchange evaluation
   int see(Square from, Square to) const;
   int see(Move m) const;
@@ -570,4 +570,8 @@ inline bool Position::move_is_capture_or_promotion(Move m) const {
   return (m & (0x1F << 12)) ? !move_is_castle(m) : !square_is_empty(move_to(m));
 }
 
+inline PieceType Position::captured_piece() const {
+  return st->capture;
+}
+
 #endif // !defined(POSITION_H_INCLUDED)