X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=0099ccd2f8e08f1a6e1b3fb2539da5cdff5b4803;hp=4dcbbf76ec80b24531fe414820fb7fe0781f8dc4;hb=0d194377033c52ff41ff990ddf31950b576ff543;hpb=8b5519a009914b07ad73a71f86dc0e9ff52b99da diff --git a/src/position.h b/src/position.h index 4dcbbf76..0099ccd2 100644 --- a/src/position.h +++ b/src/position.h @@ -213,8 +213,7 @@ public: Bitboard attacks_to(Square s) const; Bitboard attacks_to(Square s, Color c) const; bool is_check() const; - bool white_pawn_attacks_square(Square f, Square t) const; - bool black_pawn_attacks_square(Square f, Square t) const; + bool pawn_attacks_square(Color c, Square f, Square t) const; template Bitboard piece_attacks_square(Square f, Square t) const; // Dispatch at compile-time @@ -581,12 +580,8 @@ inline bool Position::is_check() const { return checkers() != EmptyBoardBB; } -inline bool Position::white_pawn_attacks_square(Square f, Square t) const { - return bit_is_set(pawn_attacks(WHITE, f), t); -} - -inline bool Position::black_pawn_attacks_square(Square f, Square t) const { - return bit_is_set(pawn_attacks(BLACK, f), t); +inline bool Position::pawn_attacks_square(Color c, Square f, Square t) const { + return bit_is_set(pawn_attacks(c, f), t); } template