Exemple #1
0
        public void GenerateTopologyAndEcology(HomelandData homelandData, IMapTemplate mapTemplate)
        {
            var regions = homelandData.OtherRegions.ToList();

            regions.Add(homelandData.StartingRegion);

            int riveredCells = 0;

            foreach (var region in regions)
            {
                var regionData = homelandData.GetDataOfRegion(region);

                RegionGenerator.GenerateTopology(region, regionData.Topology);
                RegionGenerator.PaintTerrain(region, regionData.Biome);

                riveredCells += Mathf.CeilToInt(region.LandCells.Count * regionData.Biome.RiverPercentage * 0.01f);
            }

            var allLandCells  = regions.SelectMany(region => region.LandCells);
            var allWaterCells = regions.SelectMany(region => region.WaterCells);

            RiverGenerator.CreateRivers(allLandCells, allWaterCells, riveredCells);

            RegionGenerator.AssignFloodPlains(allLandCells);

            foreach (var region in regions)
            {
                var regionData = homelandData.GetDataOfRegion(region);

                VegetationPainter.PaintVegetation(region, regionData.Biome);
            }
        }
Exemple #2
0
        public void GenerateTopologyAndEcology(OceanData oceanData)
        {
            foreach (var region in oceanData.EmptyOceanRegions)
            {
                foreach (var cell in region.Cells)
                {
                    ModLogic.ChangeTerrainOfCell(cell, CellTerrain.DeepWater);
                }
            }

            foreach (var region in oceanData.ArchipelagoRegions)
            {
                RegionData regionData = oceanData.GetRegionData(region);

                RegionGenerator.GenerateTopology(region, regionData.Topology);
                RegionGenerator.PaintTerrain(region, regionData.Biome);
                RegionGenerator.AssignFloodPlains(region.LandCells);
            }
        }