Example #1
0
        public override void Generate(Map map, GenStepParams parms)
        {
            int num = Mathf.RoundToInt((float)map.Area / 10000f * this.patchesPer10kCellsRange.RandomInRange);

            for (int i = 0; i < num; i++)
            {
                float   randomInRange = this.patchSizeRange.RandomInRange;
                IntVec3 a             = CellFinder.RandomCell(map);
                foreach (IntVec3 current in GenRadial.RadialPatternInRadius(randomInRange / 2f))
                {
                    IntVec3 c = a + current;
                    if (c.InBounds(map))
                    {
                        map.terrainGrid.SetTerrain(c, this.terrainDef);
                    }
                }
            }
        }
Example #2
0
        public override void Generate(Map map)
        {
            int num = Mathf.RoundToInt((float)((float)map.Area / 10000.0 * this.patchesPer10kCellsRange.RandomInRange));

            for (int i = 0; i < num; i++)
            {
                float   randomInRange = this.patchSizeRange.RandomInRange;
                IntVec3 a             = CellFinder.RandomCell(map);
                foreach (IntVec3 item in GenRadial.RadialPatternInRadius((float)(randomInRange / 2.0)))
                {
                    IntVec3 c = a + item;
                    if (c.InBounds(map))
                    {
                        map.terrainGrid.SetTerrain(c, this.terrainDef);
                    }
                }
            }
        }