Ejemplo n.º 1
0
        public Maze(Point coords, Point size, Point startCoords, int tunnelWidth, int wallWidth, int algorithmID, int variant, Func <Point, bool> PeekFunc, Func <Rect, bool> NukeFunc)
        {
            mazeData = new MazeData(coords, size, startCoords, tunnelWidth, wallWidth, variant);

            if (allAlgorithms.Count == 0)
            {
                allAlgorithms.Add(GrowingTree.name, new GrowingTree(PeekFunc, NukeFunc));
                allAlgorithms.Add(Braid.name, new Braid(PeekFunc, NukeFunc));
                allAlgorithms.Add(GTBraided.name, new GTBraided(PeekFunc, NukeFunc));
            }

            switch (algorithmID)
            {
            case 2:
                this.mazeAlgorithm = new Braid(PeekFunc, NukeFunc);
                break;

            case 1:
                this.mazeAlgorithm = new GTBraided(PeekFunc, NukeFunc);
                break;

            default:
                this.mazeAlgorithm = new GrowingTree(PeekFunc, NukeFunc);
                break;
            }
        }
Ejemplo n.º 2
0
        public Maze(Point coords, Point size, Point startCoords, int tunnelWidth, int wallWidth, int algorithmID, int variant, Func<Point, bool> PeekFunc, Func<Rect, bool> NukeFunc)
        {
            mazeData = new MazeData(coords, size, startCoords, tunnelWidth, wallWidth, variant);

            if (allAlgorithms.Count == 0)
            {
                allAlgorithms.Add(GrowingTree.name, new GrowingTree(PeekFunc, NukeFunc));
                allAlgorithms.Add(Braid.name, new Braid(PeekFunc, NukeFunc));
                allAlgorithms.Add(GTBraided.name, new GTBraided(PeekFunc, NukeFunc));
            }

            switch (algorithmID)
            {
                case 2:
                    this.mazeAlgorithm = new Braid(PeekFunc, NukeFunc);
                    break;
                case 1:
                    this.mazeAlgorithm = new GTBraided(PeekFunc, NukeFunc);
                    break;
                default:
                    this.mazeAlgorithm = new GrowingTree(PeekFunc, NukeFunc);
                    break;
            }
        }