Skip to main content

GeneratedBiome

A class in Root.Township, Alta.Caves.

The rolled result of a biome mix for a cave layer or area: the biomes and their weights, attributes and element chances, plus the two biomes it blends between.

Constructors​

MemberWhat it is
GeneratedBiome(int seed, Biome from, Biome to, float transition, Dictionary<Biome, float> biomeWeightings, AttributeSet attributes, Dictionary<Element, float> elementChances)Creates a GeneratedBiome from seed, from, to, transition, biomeWeightings, attributes and elementChances.

Fields​

2 private and internal fields
MemberWhat it is
private Biome[] biomesThe weighted biomes, in the same order as biomeThresholds.
private float[] biomeThresholdsRunning totals of the biome weightings, used by GetRandom to pick a biome.

Properties​

MemberWhat it is
AttributeSet Attributes { get; private set; }The biome attribute values for this area.
Dictionary<Biome, float> BiomeWeightings { get; private set; }Weight of each biome in the mix.
Dictionary<Element, float> ElementChances { get; private set; }Chance of each element.
Biome From { get; private set; }The biome it transitions from.
int Seed { get; private set; }Seed used to roll it.
Biome To { get; private set; }The biome it transitions to, or null.
float Transition { get; private set; }How far between From and To it is.

Methods​

MemberWhat it is
static GeneratedBiome Basic(int seed, Biome biome)Makes a result with a single biome at full weight.
float GetDebugValue()A number mixed from all values, for comparing two results when debugging.
Biome GetRandom()Picks a biome by weight. Assumes the weights add up to 1; anything past the total picks the first biome.

Used in​

Members of other types that take, return or hold a GeneratedBiome: