Exemplo n.º 1
0
 public static void CheckedList(int x, int y, out FruitPoint fruitPoint, out int thisElement)
 {
     for (int i = 0; i < dictionary.Count; i++)
     {
         if (dictionary[i].X == x && dictionary[i].Y == y)
         {
             fruitPoint  = dictionary[i];
             thisElement = i;
             return;
         }
     }
     fruitPoint  = null;
     thisElement = 0;
 }
Exemplo n.º 2
0
        public static void GeneratePoint()
        {
            int    x, y;
            Random random = new Random();

            x = random.Next(1, WallPointsManager.Width - 1);
            y = random.Next(1, WallPointsManager.Height - 1);
            if (!SnakePointsManager.CheckedList(x, y) && !WallPointsManager.CheckedList(x, y) && !CheckedList(x, y))
            {
                FruitPoint fruitPoint = new FruitPoint(x, y);
            }
            else
            {
                GeneratePoint();
            }
        }
Exemplo n.º 3
0
 public static void AddInList(FruitPoint thisObject)
 {
     dictionary.Add(thisObject);
 }
Exemplo n.º 4
0
 public static void AddFruitElement(int x, int y)
 {
     FruitPoint fruitPoint = new FruitPoint(x, y);
 }