+inline Bitboard attacks_bb(Piece p, Square s, Bitboard occ) {
+
+ switch (type_of(p))
+ {
+ case BISHOP: return attacks_bb<BISHOP>(s, occ);
+ case ROOK : return attacks_bb<ROOK>(s, occ);
+ case QUEEN : return attacks_bb<BISHOP>(s, occ) | attacks_bb<ROOK>(s, occ);
+ default : return StepAttacksBB[p][s];
+ }
+}