GeneratingBiome
A class in Root.Township, Alta.Caves.
Builds a GeneratedBiome by blending weighted biomes: attribute ranges and element multipliers are summed by weight, then rolled with a seed.
- Listed in World generation
- Derived types
CaveGeneratingBiome - Nested types
Range
Constructors
| Member | What it is |
|---|---|
GeneratingBiome() | Creates a GeneratingBiome with default values. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private Dictionary<BiomeAttribute, GeneratingBiome.Range> attributeRanges | Blended minimum and maximum for each biome attribute. |
private Dictionary<Biome, float> biomeWeightings | Total weight added for each biome. |
private Dictionary<Element, float> elementMultipliers | Blended multiplier for each element. |
private static Logger logger | NLog logger for this class. |
private float totalWeight | Sum of all weights added. Should be 1 by the time Generate runs. |
Methods
| Member | What it is |
|---|---|
void AddWeighting(Biome biome, float weighting) | Adds a biome with a weight, adding its attribute ranges and element multipliers (or the defaults) scaled by that weight. |
GeneratedBiome Generate(int seed, Biome from, Biome to, float transition) | Rolls the attributes from the seed, scales each element by its efficiency for them, and returns the GeneratedBiome. Warns if weights don't sum to 1. |
protected virtual void GenerateAttributes(AttributeSet attributes, Random random) | Picks a random value inside each attribute's blended range. Virtual, so a subclass can change how attributes are rolled. |
Used in
Members of other types that take, return or hold a GeneratingBiome: