play method

Position play(
  1. Move move
)

Plays a move and returns the updated Position.

Throws a PlayException if the move is not legal.

Implementation

Position play(Move move) {
  if (isLegal(move)) {
    return playUnchecked(move);
  } else {
    throw PlayException('Invalid move $move on position $fen');
  }
}