예제 #1
0
        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);
        }
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
 public void UpdateBoard(BoardNode n)
 {
     nodes[n.row, n.col].pos = BoardPosition.Red;
 }
예제 #4
0
 public Result(float s, BoardNode m)
 {
     score = s;
     move  = m;
 }