Esempio 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;
 }
Esempio 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();
            }
        }
Esempio n. 3
0
 public static void AddInList(FruitPoint thisObject)
 {
     dictionary.Add(thisObject);
 }
Esempio n. 4
0
 public static void AddFruitElement(int x, int y)
 {
     FruitPoint fruitPoint = new FruitPoint(x, y);
 }