normalizeMove method
Returns the normalized form of a NormalMove to avoid castling inconsistencies.
Implementation
Move normalizeMove(NormalMove move) {
final side = _getCastlingSide(move);
if (side == null) return move;
final castlingRook = castles.rookOf(turn, side);
return NormalMove(
from: move.from,
to: castlingRook ?? move.to,
);
}