legalMoves property
Gets all the legal moves of this position.
Returns a SquareSet of all the legal moves for each Square.
In order to support Chess960, the castling move format is encoded as the king-to-rook move only.
Use the makeLegalMoves helper to get all the legal moves including alternative castling moves.
Implementation
IMap<Square, SquareSet> get legalMoves {
final context = _makeContext();
if (context.isVariantEnd) return IMap(const {});
return IMap({
for (final s in board.bySide(turn).squares)
s: _legalMovesOf(s, context: context)
});
}