From: Marco Costalba Date: Mon, 8 Mar 2010 13:57:01 +0000 (+0100) Subject: Introduce captured_piece() X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=eaed535c5f00ee75185e798dc2fe445a11e396af Introduce captured_piece() 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 --- diff --git a/src/position.cpp b/src/position.cpp index 0336a832..f24c2f2c 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -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 diff --git a/src/position.h b/src/position.h index 591107e4..d92ed1ca 100644 --- a/src/position.h +++ b/src/position.h @@ -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)