mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08:00
Cleanup piece_attacks_square() functions
Most of them are not required to be public and are used in one place only so remove them and use its definitions. Also rename piece_attacks_square() in piece_attacks() to be aligned to the current naming policy. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -198,13 +198,9 @@ public:
|
||||
// Attack information to a given square
|
||||
Bitboard attackers_to(Square s) const;
|
||||
Bitboard attackers_to(Square s, Color c) const;
|
||||
template<PieceType> Bitboard piece_attacks(Square s) const;
|
||||
Bitboard piece_attacks(Piece p, Square s) const;
|
||||
Bitboard pawn_attacks(Square s, Color c) const;
|
||||
|
||||
// Attack information to a given square from another given square
|
||||
template<PieceType> Bitboard piece_attacks_square(Square f, Square t) const; // Dispatch at compile-time
|
||||
bool piece_attacks_square(Piece p, Square f, Square t) const; // Dispatch at run-time
|
||||
bool pawn_attacks_square(Square f, Square t, Color c) const;
|
||||
template<PieceType> Bitboard piece_attacks(Square s) const;
|
||||
|
||||
// Properties of moves
|
||||
bool pl_move_is_legal(Move m) const;
|
||||
@@ -474,15 +470,6 @@ inline bool Position::is_check() const {
|
||||
return st->checkersBB != EmptyBoardBB;
|
||||
}
|
||||
|
||||
inline bool Position::pawn_attacks_square(Square f, Square t, Color c) const {
|
||||
return bit_is_set(pawn_attacks(f, c), t);
|
||||
}
|
||||
|
||||
template<PieceType Piece>
|
||||
inline Bitboard Position::piece_attacks_square(Square f, Square t) const {
|
||||
return bit_is_set(piece_attacks<Piece>(f), t);
|
||||
}
|
||||
|
||||
inline Bitboard Position::attackers_to(Square s, Color c) const {
|
||||
|
||||
return attackers_to(s) & pieces_of_color(c);
|
||||
|
||||
Reference in New Issue
Block a user