예제 #1
0
        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;
        }
예제 #2
0
 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;
 }