Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros
WorldGenerator.cs
Go to the documentation of this file.
4
6
7public class WorldGenerator
8{
9 private readonly List<GenPass> _passes = new List<GenPass>();
10
11 private double _totalLoadWeight;
12
13 private readonly int _seed;
14
16
18
19 public WorldGenerator(int seed, WorldGenConfiguration configuration)
20 {
21 _seed = seed;
22 _configuration = configuration;
23 }
24
25 public void Append(GenPass pass)
26 {
28 _totalLoadWeight += pass.Weight;
29 }
30
32 {
34 double num = 0.0;
35 foreach (GenPass pass in _passes)
36 {
37 num += pass.Weight;
38 }
39 if (progress == null)
40 {
42 }
44 progress.TotalWeight = num;
45 foreach (GenPass pass2 in _passes)
46 {
47 WorldGen._genRand = new UnifiedRandom(_seed);
48 Main.rand = new UnifiedRandom(_seed);
49 stopwatch.Start();
50 progress.Start(pass2.Weight);
52 progress.End();
53 stopwatch.Reset();
54 }
56 }
57}
void Add(TKey key, TValue value)
GameConfiguration GetPassConfiguration(string name)
readonly WorldGenConfiguration _configuration
WorldGenerator(int seed, WorldGenConfiguration configuration)
static GenerationProgress CurrentGenerationProgress
void GenerateWorld(GenerationProgress progress=null)
readonly List< GenPass > _passes