Exemple #1
0
 public void RegenerateMaze()
 {
     if (mazeGenerators.Length == 0)
     {
         return;
     }
     if (currentMazeGenerator == null)
     {
         currentMazeGenerator = mazeGenerators[0];
     }
     pool.ClearPool();
     grid = currentMazeGenerator.Generate();
     CreateVisualMaze(grid);
 }
Exemple #2
0
        public int GetCurrentGeneratorIndex()
        {
            if (currentMazeGenerator == null)
            {
                currentMazeGenerator = mazeGenerators[0];
            }

            for (int i = 0; i < mazeGenerators.Length; i++)
            {
                if (currentMazeGenerator == mazeGenerators[i])
                {
                    return(i);
                }
            }

            return(-1);
        }
Exemple #3
0
 public void SetGenerationMethod(int index)
 {
     currentMazeGenerator = mazeGenerators[index];
 }