private ShuffleAlgorithmMode _shuffleAlgorithmMode; // Shuffle Algorithm Mode set // Constructor public Maze(GameObject mazeParent, GameObject[] blockTypes, Tuple3 <int> dimensions, Tuple3 <int> startingPosition, MazeAlgorithmMode mazeAlgo = MazeAlgorithmMode.GrowingTree, ShuffleAlgorithmMode shuffleAlgo = ShuffleAlgorithmMode.AStar) { parent = mazeParent; parent.tag = "Maze"; rotating = false; mazeDimensions = dimensions; this.startingPosition = startingPosition; _blockTypes = blockTypes; _blockMaze = new Block[mazeDimensions.first, mazeDimensions.second, mazeDimensions.third]; _blockMap = new bool[mazeDimensions.first, mazeDimensions.second, mazeDimensions.third]; SetAlgorithm(mazeAlgo); SetShuffle(shuffleAlgo); }
// Sets the shuffle algorithm, defaults to AStar public void SetShuffle(ShuffleAlgorithmMode shuffleMode) { switch (shuffleMode) { case ShuffleAlgorithmMode.AStar: _shuffleAlgorithm = new ShuffleDelegate(ShuffleAlgorithm.AStar); break; case ShuffleAlgorithmMode.Directed: _shuffleAlgorithm = new ShuffleDelegate(ShuffleAlgorithm.Directed); break; case ShuffleAlgorithmMode.ForceDirected: _shuffleAlgorithm = new ShuffleDelegate(ShuffleAlgorithm.ForceDirected); break; } }