Esempio n. 1
0
        public static void FillMaze(bool empty = false)
        {
            for (int row = 0; row < Config.Y_COUNT; row++)     // Loop all rows
            {
                for (int col = 0; col < Config.X_COUNT; col++) // Loop all columns
                {
                    int value = Cell.GetValue(col, row);
                    int next  = 1;
                    if (empty)
                    {
                        next = 0;
                    }

                    if (value >= 2 && value <= 6)
                    {
                        if (value == 2)
                        {
                            Cell.Get(col, row).Selected = true;
                            Stairs.Remove(next);
                        }
                    }
                    else
                    {
                        Cell.SetValue(next, col, row);
                    }
                }
            }
            Cell.ReloadAllInfo();
        }
Esempio n. 2
0
 public static void FillBorders()
 {
     for (int row = 0; row < Config.Y_COUNT; row++)
     {
         for (int col = 0; col < Config.X_COUNT; col++)
         {
             if (row == 0 || row == Config.Y_COUNT - 1 || col == 0 || col == Config.X_COUNT - 1)
             {
                 int value = Cell.GetValue(col, row);
                 if (value >= 2 && value <= 6)
                 {
                     if (value == 2)
                     {
                         Cell.Get(col, row).Selected = true;
                         Stairs.Remove(1);
                     }
                 }
                 else
                 {
                     Cell.SetValue(1, col, row);
                 }
             }
         }
     }
     Cell.ReloadAllInfo();
 }
Esempio n. 3
0
 private void removeStairsButton_Click(object sender, EventArgs e)
 {
     Stairs.Remove();
 }