private NoughtsAndCrossesPosition(NoughtsAndCrossesPiece[][] board) { if (board?.Length == 0) { throw new ArgumentException($"{nameof(board)} is empty or null."); } int size = board.Length; _board = new NoughtsAndCrossesPiece[size][]; for (int i = 0; i < size; i++) { if (board[i].Length != size) { throw new ArgumentException($"{nameof(board)} is not square."); } _board[i] = new NoughtsAndCrossesPiece[size]; for (int j = 0; j < size; j++) { _board[i][j] = board[i][j]; } } }
internal NoughtsAndCrossesPosition(int size) { _board = new NoughtsAndCrossesPiece[size][]; for (int i = 0; i < size; i++) { _board[i] = new NoughtsAndCrossesPiece[size]; for (int j = 0; j < size; j++) { _board[i][j] = new Space(); } } }