예제 #1
0
        private MapData MakeMap()
        {
            this.Map = new LinkedMap();
            if (this.Settings.IsLabyrinth)
            {
                this.GenerateLabyrinth();
            }
            else
            {
                this.GeneratePathway();
            }

            var map = new MapData(this.Key);

            typeof(MapData).GetField("DashlessGoldenberries").SetValue(map, new List <EntityData>());
            map.Levels = new List <LevelData>();
            this.Map.FillMap(map, this.Settings, this.Random);
            this.SetMapBounds(map);
            this.SetForeground(map);
            this.SetBackground(map);
            this.SetPoem();
            this.SpawnGolden(map);
            this.SetDarkness(map);
            this.PlaceTheoPhone(map);

            return(map);
        }
예제 #2
0
        private MapData MakeMap()
        {
            this.Map = new LinkedMap();
            switch (this.Settings.Algorithm)
            {
            case LogicType.Labyrinth:
                this.GenerateLabyrinth();
                break;

            case LogicType.Pathway:
                this.GeneratePathway();
                break;
            }

            var map = new MapData(this.Key);

            map.Levels = new List <LevelData>();
            this.Map.FillMap(map, this.Random);
            this.SetMapBounds(map);
            this.SetForeground(map);
            this.SetBackground(map);
            this.SetPoem();
            this.SpawnGolden(map);
            this.SetDarkness(map);

            return(map);
        }
예제 #3
0
        private MapData MakeMap()
        {
            this.Map = new LinkedMap();

            switch (this.Settings.Algorithm)
            {
            case LogicType.Labyrinth:
            default:
                this.Tasks.AddToFront(new TaskLabyrinthStart(this));
                break;

            case LogicType.Pathway:
                this.Tasks.AddToFront(new TaskPathwayStart(this));
                break;
            }

            while (this.Tasks.Count != 0)
            {
                var nextTask = this.Tasks.RemoveFromFront();

                while (!nextTask.Next())
                {
                    if (this.CompletedTasks.Count == 0)
                    {
                        throw new Exception("Could not generate map");
                    }

                    this.Tasks.AddToFront(nextTask);
                    nextTask = this.CompletedTasks.Pop();
                    nextTask.Undo();
                }

                this.CompletedTasks.Push(nextTask);
            }

            var map = new MapData(this.Key);

            map.Levels = new List <LevelData>();

            this.Map.FillMap(map, this.Random);
            this.SetMapBounds(map);
            this.SetForeground(map);
            this.SetBackground(map);
            this.SetPoem();
            this.SpawnGolden(map);
            this.SetDarkness(map);

            return(map);
        }