Generate() public static method

public static Generate ( TerrainData terrain, Random random ) : void
terrain TerrainData
random System.Random
return void
        public static TerrainData CreateNoiseTerrain(IntSize3 size, Random random)
        {
            var terrain = new TerrainData(size);

            var noise    = CreateTerrainNoise();
            var noisemap = CreateTerrainNoiseMap(noise, new IntSize2(size.Width, size.Height));

            FillFromNoiseMap(terrain, noisemap);

            terrain.RescanLevelMap();

            double xk = (random.NextDouble() * 2 - 1) * 0.01;
            double yk = (random.NextDouble() * 2 - 1) * 0.01;

            TerrainHelpers.CreateBaseMinerals(terrain, random, xk, yk);

            TerrainHelpers.CreateOreVeins(terrain, random, xk, yk);

            TerrainHelpers.CreateOreClusters(terrain, random);

            RiverGen.Generate(terrain, random);

            int soilLimit = size.Depth * 4 / 5;

            TerrainHelpers.CreateSoil(terrain, soilLimit);

            int grassLimit = terrain.Depth * 4 / 5;

            TerrainHelpers.CreateVegetation(terrain, random, grassLimit);

            return(terrain);
        }