- 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());
+ return Pt == BISHOP || Pt == ROOK ? attacks_bb<Pt>(s, pieces())
+ : Pt == QUEEN ? attacks_from<ROOK>(s) | attacks_from<BISHOP>(s)
+ : StepAttacksBB[Pt][s];