getAttackers method
Finds all the pieces for player
attacking square
.
Returns a list of the squares those pieces are on.
Implementation
Set<int> getAttackers(int square, int player) =>
generatePlayerMoves(player, MoveGenParams.squareAttacks(square, false))
.map((e) => e.from)
.toSet();