-template<PieceType Piece> // Knight and King and white pawns
-inline Bitboard Position::attacks_from(Square s) const {
- return StepAttacksBB[Piece][s];
-}
-
-template<>
-inline Bitboard Position::attacks_from<BISHOP>(Square s) const {
- return bishop_attacks_bb(s, occupied_squares());
-}
-
-template<>
-inline Bitboard Position::attacks_from<ROOK>(Square s) const {
- return rook_attacks_bb(s, occupied_squares());
+inline Bitboard Position::attacks_from(Piece p, Square s) const {
+ return attacks_from(p, s, byTypeBB[ALL_PIECES]);