Class PathProcessor

Public

Handles path calculations and thread management.

Inner Types

Prevents pathfinding from running while held.

Public Methods

AbortThreads ()

Calls 'Abort' on each of the threads.

Public
DestroyNode (node)

Destroyes the given node.

Public
GetNewNodeIndex ()

Returns a new global node index.

Public
InitializeNode (node)

Initializes temporary path data for a node.

Public
JoinThreads ()

Calls 'Join' on each of the threads to block until they have completed.

Public
PausePathfinding (block)

Prevents pathfinding threads from starting to calculate any new paths.

Public
TickNonMultithreaded ()
Public

Public Variables

IsUsingMultithreading

Returns whether or not multithreading is used.

Public
NumThreads

Number of parallel pathfinders.

Public

Public Events

OnPathPostSearch

Called after every path request.

Public
OnPathPreSearch

Called before every path request.

Public
OnQueueUnblocked
Public

Private/Protected Members

astar

Reference to main AstarPath object.

Private Readonly
CalculatePaths (pathHandler)

Main pathfinding method.

Private
CalculatePathsThreaded (pathHandler)

Main pathfinding method (multithreaded).

Private
Lock (block)
Private
locks
Private Readonly
nextLockID
Private
nextNodeIndex

Holds the next node index which has not been used by any previous node.

Private
nodeIndexPool

Holds indices for nodes that have been destroyed.

Private Readonly
pathHandlers
Private Readonly
PathProcessor (astar, returnQueue, processors, multithreaded, pathHandlerProvider)

Creates a new path processor.

Package
queue

Queue for paths waiting to be calculated.

Package Readonly
returnQueue

Queue to which completed paths will be added.

Private Readonly
threadCoroutine

When no multithreading is used, the IEnumerator is stored here.

Private
threads

References to each of the pathfinding threads.

Private Readonly
Unlock (id)
Private