Skip to main content

Path<TNode, TPath>

A class in Root.Township, Alta.Forests.

A one-way connection between two nodes in the forest graph, used for A* search. Path adds edge and side information.

Constructors​

MemberWhat it is
Path(TNode from, TNode to, float length)Creates a Path from from, to and length.

Properties​

MemberWhat it is
float Cost { get; private set; }The path's cost, its length when built from an edge.
Vector2 Direction { get; }The vector from From to To divided by Cost; a unit vector when the cost is the length.
TNode From { get; private set; }Start node.
bool IsEnabled { get; private set; }Whether the path can be used. Always true in this build.
TNode To { get; private set; }End node.
Vector2 Vector { get; }The 2D vector from From to To.