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).
- Listed in World generation
- Inherits or implements
NodeMapModifier
Constructors
| Member | What it is |
|---|---|
ForestAttributeEvaluator() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private ForestBiome[] biomes | Biomes a node can be placed in when isEvaluatingBiomes is on. |
private SpecialBiomeAttributes definitions | The special biome attributes (radius, elevation, slope and so on) this step writes. |
private bool isDoingNodes | Whether Modify evaluates nodes. |
private bool isDoingPaths | Whether Modify evaluates edges. |
private bool isEvaluatingBiomes | Whether node attributes get parented to the biome found at the node's position. |
private bool isEvaluatingNodeContext | Whether node context attributes (elevation, depth, border distance) are written. |
private bool isEvaluatingPathContext | Whether edge context attributes (elevation, slope, relative elevation) are written. |
private static Logger logger | NLog logger for this class. |
Methods
| Member | What 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
| Member | What 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. |