Exemplo n.º 1
0
        public override void Build(SceneGame world)
        {
            World  = world;
            Random = new Random(Seed);

            Map         = world.CreateMap(100, 100);
            Map.Bonuses = Bonuses;
            world.SetMapId(Guid.NewGuid(), Map);

            foreach (var bonus in Bonuses)
            {
                bonus.Bonus.Apply(GroupGenerator);
            }

            MapGenerator generator = new MapGenerator(Map.Width, Map.Height, Seed, GroupGenerator, Bonuses);

            generator.SetupDefaultOres();
            generator.Generate();
            generator.Print(Map);

            Rooms = generator.GetRooms(Map).ToList();

            int followups = 1;

            if (Random.NextDouble() < 0.4)
            {
                followups = Random.Next(2, 4);
            }
            for (int i = 0; i < followups; i++)
            {
                var       nextStair = BuildStairRoom();
                var       group     = nextStair.Group;
                StairDown stairTile = new StairDown()
                {
                    Type = StairType.Random,
                    Seed = Random.Next(),
                };
                stairTile.InitBonuses();
                nextStair.Replace(stairTile);
            }
        }
Exemplo n.º 2
0
        public override void Build(SceneGame world)
        {
            World  = world;
            Random = new Random(Seed);

            Map         = world.CreateMap(100, 100);
            Map.Bonuses = Bonuses;

            MapGenerator generatorHome = new MapGenerator(Map.Width, Map.Height, Seed, new GroupSet(GroupGenerator.Home), Bonuses)
            {
                PointCount     = 7,
                PointDeviation = 35,
            };

            generatorHome.Generate();
            generatorHome.Print(Map);

            Rooms = generatorHome.GetRooms(Map).ToList();

            BuildSmeltery(Rooms);
            BuildStoreRoom(Rooms);
        }