-/// lsb()/msb() finds the least/most significant bit in a nonzero bitboard.
-/// pop_lsb() finds and clears the least significant bit in a nonzero bitboard.
+ 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];
+ }
+}
+
+/// lsb()/msb() finds the least/most significant bit in a non-zero bitboard.
+/// pop_lsb() finds and clears the least significant bit in a non-zero bitboard.