A* Pathfinding Project  4.1.6
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
PathHandler Class Reference

Handles thread specific path data. More...

Detailed Description

Handles thread specific path data.

Public Member Functions

 PathHandler (int threadID, int totalThreadCount)
 
void ClearPathIDs ()
 Set all nodes' pathIDs to 0.
 
void DestroyNode (GraphNode node)
 Internal method to clean up node data.
 
PathNode GetPathNode (int nodeIndex)
 
PathNode GetPathNode (GraphNode node)
 Returns the PathNode corresponding to the specified node.
 
void InitializeForPath (Path p)
 
void InitializeNode (GraphNode node)
 Internal method to initialize node data.
 

Public Attributes

readonly System.Text.StringBuilder DebugStringBuilder = new System.Text.StringBuilder()
 StringBuilder that paths can use to build debug strings.
 
readonly BinaryHeap heap = new BinaryHeap(128)
 Binary heap to keep track of nodes on the "Open list".
 
PathNode[] nodes = new PathNode[0]
 Array of all PathNodes.
 
readonly int threadID
 
readonly int totalThreadCount
 

Properties

ushort PathID [get]
 ID for the path currently being calculated or last path that was calculated.
 

Private Attributes

ushort pathID
 Current PathID.
 

Constructor & Destructor Documentation

PathHandler ( int  threadID,
int  totalThreadCount 
)

Member Function Documentation

void ClearPathIDs ( )

Set all nodes' pathIDs to 0.

See Also
Pathfinding.PathNode.pathID
void DestroyNode ( GraphNode  node)

Internal method to clean up node data.

PathNode GetPathNode ( int  nodeIndex)
PathNode GetPathNode ( GraphNode  node)

Returns the PathNode corresponding to the specified node.

The PathNode is specific to this PathHandler since multiple PathHandlers are used at the same time if multithreading is enabled.

void InitializeForPath ( Path  p)
void InitializeNode ( GraphNode  node)

Internal method to initialize node data.

Member Data Documentation

readonly System.Text.StringBuilder DebugStringBuilder = new System.Text.StringBuilder()

StringBuilder that paths can use to build debug strings.

Better for performance and memory usage to use a single StringBuilder instead of each path creating its own

readonly BinaryHeap heap = new BinaryHeap(128)

Binary heap to keep track of nodes on the "Open list".

See Also
https://en.wikipedia.org/wiki/A*_search_algorithm
PathNode [] nodes = new PathNode[0]

Array of all PathNodes.

ushort pathID
private

Current PathID.

See Also
PathID
readonly int threadID
readonly int totalThreadCount

Property Documentation

ushort PathID
get

ID for the path currently being calculated or last path that was calculated.


The documentation for this class was generated from the following file: