public void Copy(Board board) { this.board = new Piece[8, 8]; this.turn = board.GetTurn(); this.playerColour = board.GetPlayerColour(); this.ai = board.GetAIState(); for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (board.GetPiece(i, j) != null) { if (board.GetPiece(i, j).IsDux()) { this.board[i, j] = new Dux(board.GetPiece(i, j).GetColour()); } else { this.board[i, j] = new Pawn(board.GetPiece(i, j).GetColour()); } } else { this.board[i, j] = null; } } } }
public void Copy(Board board) { this.board = new Piece[8, 8]; this.turn = board.GetTurn(); this.playerColour = board.GetPlayerColour(); this.ai = board.GetAIState(); for (int i = 0; i < 8; i++) for (int j = 0; j < 8; j++) { if (board.GetPiece(i, j) != null) { if (board.GetPiece(i, j).IsDux()) this.board[i, j] = new Dux(board.GetPiece(i, j).GetColour()); else this.board[i, j] = new Pawn(board.GetPiece(i, j).GetColour()); } else this.board[i, j] = null; } }