Skip to main content

ForestAttributeEvaluator

A class in Root.Township, Alta.Forests.

A node map step in forest generation that fills in biome attributes on nodes and edges (biome, elevation, slope, depth from the entrance, distance to border).

Constructors​

MemberWhat it is
ForestAttributeEvaluator()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

8 private and internal fields
MemberWhat it is
private ForestBiome[] biomesBiomes a node can be placed in when isEvaluatingBiomes is on.
private SpecialBiomeAttributes definitionsThe special biome attributes (radius, elevation, slope and so on) this step writes.
private bool isDoingNodesWhether Modify evaluates nodes.
private bool isDoingPathsWhether Modify evaluates edges.
private bool isEvaluatingBiomesWhether node attributes get parented to the biome found at the node's position.
private bool isEvaluatingNodeContextWhether node context attributes (elevation, depth, border distance) are written.
private bool isEvaluatingPathContextWhether edge context attributes (elevation, slope, relative elevation) are written.
private static Logger loggerNLog logger for this class.

Methods​

MemberWhat it is
override void Modify(ForestGeneration forest)Runs EvaluateNode on every node and EvaluateEdge on every edge, as the flags allow, with a random seeded from the forest seed.
3 private and internal methods
MemberWhat it is
private void Awake()Caches the SpecialBiomeAttributes global settings into definitions.
private void EvaluateEdge(ForestGeneration forest, Random random, Edge edge)Sets each edge attribute to the average of its two nodes, then optionally elevation, slope and relative elevation range.
private void EvaluateNode(ForestGeneration forest, Random random, Node node)Parents the node's attributes to its biome and sets radius, elevation, relative elevation range, traversal depth and distance from border.