X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=d47d84b7633c40924e38439e4b41a4fb0dd54ba6;hp=de6d186bc1c19bc3f97b43d229e850ead260ba42;hb=f74f42b2982e25e180417948771843e8bb6bd4b7;hpb=0e0adfe2e1a01ca5f46af495e14c41e23ffaa4d0 diff --git a/src/position.h b/src/position.h index de6d186b..d47d84b7 100644 --- a/src/position.h +++ b/src/position.h @@ -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 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 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 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 -inline Bitboard Position::piece_attacks_square(Square f, Square t) const { - return bit_is_set(piece_attacks(f), t); -} - inline Bitboard Position::attackers_to(Square s, Color c) const { return attackers_to(s) & pieces_of_color(c);