attacksTo method
Finds the squares who are attacking square by the attacker Side.
Implementation
SquareSet attacksTo(Square square, Side attacker, {SquareSet? occupied}) =>
bySide(attacker).intersect(rookAttacks(square, occupied ?? this.occupied)
.intersect(rooksAndQueens)
.union(bishopAttacks(square, occupied ?? this.occupied)
.intersect(bishopsAndQueens))
.union(knightAttacks(square).intersect(knights))
.union(kingAttacks(square).intersect(kings))
.union(pawnAttacks(attacker.opposite, square).intersect(pawns)));