play method

Position<T> play(
  1. Move move
)

Plays a move and returns the updated Position.

Throws a PlayError if the move is not legal.

Implementation

Position<T> play(Move move) {
  if (isLegal(move)) {
    return playUnchecked(move);
  } else {
    throw PlayError('Invalid move $move');
  }
}