copy method

Chess copy()

Deep copy of the current Chess instance

Implementation

Chess copy() {
  return Chess()
    ..board = List<Piece?>.from(board)
    ..kings = ColorMap<int>.clone(kings)
    ..turn = turn
    ..castling = ColorMap<int>.clone(castling)
    ..ep_square = ep_square
    ..half_moves = half_moves
    ..move_number = move_number
    ..history = List<State>.from(history)
    ..header = Map.from(header);
}