getKingAttackers method

Set<int> getKingAttackers(
  1. int player
)

Finds all pieces attacking player's king. Returns a list of the squares those pieces are on.

Implementation

Set<int> getKingAttackers(int player) =>
    getAttackers(state.royalSquares[player], player.opponent);