Skip to main content

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.

Constructors​

MemberWhat it is
GeneratingBiome()Creates a GeneratingBiome with default values.

Fields​

5 private and internal fields
MemberWhat it is
private Dictionary<BiomeAttribute, GeneratingBiome.Range> attributeRangesBlended minimum and maximum for each biome attribute.
private Dictionary<Biome, float> biomeWeightingsTotal weight added for each biome.
private Dictionary<Element, float> elementMultipliersBlended multiplier for each element.
private static Logger loggerNLog logger for this class.
private float totalWeightSum of all weights added. Should be 1 by the time Generate runs.

Methods​

MemberWhat 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: