CreateRiverPath() public method

public CreateRiverPath ( ) : bool
return bool
コード例 #1
0
        public void Generate(DiamondSquare.CornerData corners, double range, double h, double amplify)
        {
            GenerateHeightMap(corners, range, h, amplify);

            FillMap();

            var random  = m_random;
            var terrain = m_data;

            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);

            if (m_data.Width > 128)
            {
                var riverGen = new RiverGen(m_data, m_random);
                if (riverGen.CreateRiverPath())
                {
                    riverGen.AdjustRiver();
                }
                else
                {
                    Trace.TraceError("Failed to create river");
                }
            }

            int soilLimit = m_size.Depth * 4 / 5;

            TerrainHelpers.CreateSoil(m_data, soilLimit);
        }
コード例 #2
0
ファイル: TerrainGenerator.cs プロジェクト: tomba/dwarrowdelf
        public void Generate(DiamondSquare.CornerData corners, double range, double h, double amplify)
        {
            GenerateHeightMap(corners, range, h, amplify);

            FillMap();

            var random = m_random;
            var terrain = m_data;

            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);

            if (m_data.Width > 128)
            {
                var riverGen = new RiverGen(m_data, m_random);
                if (riverGen.CreateRiverPath())
                {
                    riverGen.AdjustRiver();
                }
                else
                {
                    Trace.TraceError("Failed to create river");
                }
            }

            int soilLimit = m_size.Depth * 4 / 5;
            TerrainHelpers.CreateSoil(m_data, soilLimit);
        }
コード例 #3
0
ファイル: RiverGen.cs プロジェクト: tomba/dwarrowdelf
 public static void Generate(TerrainData terrain, Random random)
 {
     var riverGen = new RiverGen(terrain, random);
     if (riverGen.CreateRiverPath())
     {
         riverGen.AdjustRiver();
     }
     else
     {
         Trace.TraceError("Failed to create river");
     }
 }
コード例 #4
0
ファイル: RiverGen.cs プロジェクト: jaenudin86/dwarrowdelf
        public static void Generate(TerrainData terrain, Random random)
        {
            var riverGen = new RiverGen(terrain, random);

            if (riverGen.CreateRiverPath())
            {
                riverGen.AdjustRiver();
            }
            else
            {
                Trace.TraceError("Failed to create river");
            }
        }