Exemplo n.º 1
0
 public bool PutStone(CellPoint point, StoneColor color)
 {
     if (rule.CanPutStoneToCell(new Stone(color), this.Board.GetCell(point)))
     {
         rule.PutStoneToCell(new Stone(color), this.Board.GetCell(point));
         MoveToNextPalyer();
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 public int[] SelectPoint(Board board)
 {
     foreach (Cell cell in board.cells)
     {
         if (rule.CanPutStoneToCell(new Stone(this.Color), cell))
         {
             return(new int[2] {
                 cell.Point.X, cell.Point.Y
             });
         }
     }
     return(new int[2] {
         0, 0
     });
 }
Exemplo n.º 3
0
        public int[] SelectPoint(Board board)
        {
            int maxEvaluation = 0;

            int[] point = new int[2];
            foreach (Cell cell in board.cells)
            {
                if (rule.CanPutStoneToCell(new Stone(this.Color), cell))
                {
                    if (maxEvaluation < evaluation[cell.Point.X - 1, cell.Point.Y - 1])
                    {
                        point[0] = cell.Point.X;
                        point[1] = cell.Point.Y;
                    }
                }
            }
            return(point);
        }