mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 01:27:16 +08:00
Rename square_empty() to is_empty()
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -106,7 +106,7 @@ public:
|
||||
Piece piece_on(Square s) const;
|
||||
Square king_square(Color c) const;
|
||||
Square ep_square() const;
|
||||
bool square_empty(Square s) const;
|
||||
bool is_empty(Square s) const;
|
||||
const Square* piece_list(Color c, PieceType pt) const;
|
||||
int piece_count(Color c, PieceType pt) const;
|
||||
|
||||
@@ -249,7 +249,7 @@ inline Piece Position::piece_moved(Move m) const {
|
||||
return board[from_sq(m)];
|
||||
}
|
||||
|
||||
inline bool Position::square_empty(Square s) const {
|
||||
inline bool Position::is_empty(Square s) const {
|
||||
return board[s] == NO_PIECE;
|
||||
}
|
||||
|
||||
@@ -416,14 +416,14 @@ inline bool Position::is_chess960() const {
|
||||
inline bool Position::is_capture_or_promotion(Move m) const {
|
||||
|
||||
assert(is_ok(m));
|
||||
return is_special(m) ? !is_castle(m) : !square_empty(to_sq(m));
|
||||
return is_special(m) ? !is_castle(m) : !is_empty(to_sq(m));
|
||||
}
|
||||
|
||||
inline bool Position::is_capture(Move m) const {
|
||||
|
||||
// Note that castle is coded as "king captures the rook"
|
||||
assert(is_ok(m));
|
||||
return (!square_empty(to_sq(m)) && !is_castle(m)) || is_enpassant(m);
|
||||
return (!is_empty(to_sq(m)) && !is_castle(m)) || is_enpassant(m);
|
||||
}
|
||||
|
||||
inline PieceType Position::captured_piece_type() const {
|
||||
|
||||
Reference in New Issue
Block a user