public Board MakeMove(BoardNode n, bool AIChance) { Board newBoard = new Board(nodes, gridsize); //Board newBoard = (Board)this.MemberwiseClone(); //newBoard.nodes = new BoardNode[gridsize, gridsize]; //for (int row = 0; row < gridsize; ++row) //{ // for (int col = 0; col < gridsize; ++col) // { // newBoard.nodes[row, col] = new Board(row, col, ); // } //} if (AIChance) { newBoard.nodes[n.row, n.col].pos = BoardPosition.Red; } else { newBoard.nodes[n.row, n.col].pos = BoardPosition.Green; } return(newBoard); }
public Board(BoardNode[,] grids, int size) { gridsize = size; nodes = new BoardNode[gridsize, gridsize]; for (int row = 0; row < gridsize; ++row) { for (int col = 0; col < gridsize; ++col) { nodes[row, col] = new BoardNode(row, col, grids[row, col].pos); } } }
public void UpdateBoard(BoardNode n) { nodes[n.row, n.col].pos = BoardPosition.Red; }
public Result(float s, BoardNode m) { score = s; move = m; }