PathNode

References
A single node in a recursive path structure. This is an alternate way to represent multiple paths, particularly handy for diagramming purposes.

Constructors

PathNode

#
public PathNode()
Create a new root node.

PathNode

#
public PathNode(Path partialPath)
Create a new path node.
partialPath (Path)

Properties

AllNodes

#
public IEnumerable<PathNode> AllNodes { get; }
Recurse over this node and all child nodes.

Count

#
public int Count { get; }
Gets the number of child nodes.

DiagramColour

#
public Color DiagramColour { get; set; }
Property for storing the diagram colour of this node.

DiagramCurve

#
public Curve DiagramCurve { get; set; }
Property for storing the diagram curve leading up to this node.

DiagramDot

#
public TextDot DiagramDot { get; set; }
Property for storing the diagram textdot of this node.

Leaf

#
public bool Leaf { get; }
Gets whether this node represents a full path. This property might change over time from false to true, as more paths are inserted into a node-graph.

Path

#
public Path Path { get; }
Gets the (possibly partial) path from the root up to this node.

Root

#
public bool Root { get; }
Gets whether this node represents the root. This property never changes.

Indexers

this[]

#
public PathNode this[int index] { get; }
Gets the child node at the given index.
index (int)

Methods

CompareTo

#
public int CompareTo(PathNode other)
other (PathNode)

Equals

#
public override bool Equals(object obj)
obj (object)
Object.Equals

Equals

#
public bool Equals(PathNode other)
other (PathNode)

GetHashCode

#
public override int GetHashCode()

Insert

#
public void Insert(Path fullPath)
Insert a new path into this node. Full paths should only be inserted into the root node.
fullPath (Path)

ResolveColour

#
public void ResolveColour()
Resolve the colour of this node based on the average of all child nodes. Before calling this method, ensure that all Leaf nodes in the entire hierarchy have had their colour assigned.

ToString

#
public override string ToString()
Object.ToString