Skip to main content

Node<TNode, TPath>

A class in Root.Township, Alta.Forests.

A point in a forest generation graph (river and path networks), with a 2D position, height and connecting paths. Can be searched with A-star.

Constructors​

MemberWhat it is
Node(int index, Vector2 position, float height)Creates a Node from index, position and height.

Properties​

MemberWhat it is
AttributeSet Attributes { get; }Biome attributes at this node.
float Height { get; set; }Ground height at the node.
int Index { get; private set; }Position of the node in its graph's list.
bool IsHeightFixed { get; set; }If true, the height shouldn't be changed by later steps, probably.
bool IsUsed { get; set; }Flag set by generation steps when the node has been used.
string Name { get; }Text label with the index and position.
List<TPath> NewPaths { get; private set; }Paths being built for the next version of the graph.
float OldHeight { get; set; }Height before the last change, probably kept while smoothing.
List<TPath> Paths { get; private set; }Paths connected to this node.
Vector2 Position { get; private set; }Position on the ground plane (x and z).
Vector3 Position3d { get; }World position with the height as y.

Methods​

MemberWhat it is
void ApplyNewPaths()Makes the new paths current and clears the new list.
float CalculateHeuristic(TNode target)Flat distance to the target, for A-star.
ICollection<TPath> GetConnectionsForAStar()The paths, for A-star searches.