mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-18 16:16:23 +08:00
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 <mcostalba@gmail.com>
This commit is contained in:
@@ -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
|
/// 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
|
/// 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
|
/// this function: One which takes a destination square as input, one takes a
|
||||||
|
|||||||
@@ -224,6 +224,9 @@ public:
|
|||||||
bool move_is_passed_pawn_push(Move m) const;
|
bool move_is_passed_pawn_push(Move m) const;
|
||||||
bool move_attacks_square(Move m, Square s) const;
|
bool move_attacks_square(Move m, Square s) const;
|
||||||
|
|
||||||
|
// Piece captured with previous moves
|
||||||
|
PieceType captured_piece() const;
|
||||||
|
|
||||||
// Information about pawns
|
// Information about pawns
|
||||||
bool pawn_is_passed(Color c, Square s) const;
|
bool pawn_is_passed(Color c, Square s) const;
|
||||||
static bool pawn_is_passed(Bitboard theirPawns, Color c, Square s);
|
static bool pawn_is_passed(Bitboard theirPawns, Color c, Square s);
|
||||||
@@ -241,9 +244,6 @@ public:
|
|||||||
void do_null_move(StateInfo& st);
|
void do_null_move(StateInfo& st);
|
||||||
void undo_null_move();
|
void undo_null_move();
|
||||||
|
|
||||||
// Past
|
|
||||||
PieceType captured_piece() const;
|
|
||||||
|
|
||||||
// Static exchange evaluation
|
// Static exchange evaluation
|
||||||
int see(Square from, Square to) const;
|
int see(Square from, Square to) const;
|
||||||
int see(Move m) 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));
|
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)
|
#endif // !defined(POSITION_H_INCLUDED)
|
||||||
|
|||||||
Reference in New Issue
Block a user