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