public void SetGeneratingAlgorithm(int algorithm) { switch (algorithm) { case 0: generatingAlgorithm = new HuntKillGeneratingAlgorithm(); break; case 1: generatingAlgorithm = new KruskalGeneratingAlgorithm(); break; case 2: generatingAlgorithm = new PrimsGeneratingAlgorithm(); break; case 3: generatingAlgorithm = new RecursiveGeneratingAlgorithm(); break; case 4: generatingAlgorithm = new RecursiveBacktrackerGeneratingAlgorithm(); break; } _mazeEdges = null; solved = false; }
public Maze(int width, int height, ISolvingAlgorithm solving, IGeneratingAlgorithm generating) { maze = new UpTree(width, height); this.width = width; this.height = height; solvingAlgorithm = solving; generatingAlgorithm = generating; start = 0; end = (width * height) - 1; }