A* Pathfinding Project
3.8.5
The A* Pathfinding Project for Unity 3D
|
Classes | |
class | IndexedQueue< T > |
Similar to Queue<T> but allows random access. More... | |
Public Member Functions | |
WorkItemProcessor (AstarPath astar) | |
void | AddWorkItem (AstarWorkItem itm) |
Add a work item to be processed when pathfinding is paused. | |
void | EnsureValidFloodFill () |
If a WorkItem needs to have a valid flood fill during execution, call this method to ensure there are no pending flood fills. | |
void | OnFloodFill () |
bool | ProcessWorkItems (bool force) |
Process graph updating work items. | |
Public Member Functions inherited from IWorkItemContext | |
void | EnsureValidFloodFill () |
If a WorkItem needs to have a valid flood fill during execution, call this method to ensure there are no pending flood fills. | |
void | QueueFloodFill () |
Call during work items to queue a flood fill. | |
Properties | |
bool | workItemsInProgress [get, set] |
True while a batch of work items are being processed. | |
Private Member Functions | |
void IWorkItemContext. | QueueFloodFill () |
Call during work items to queue a flood fill. | |
Private Attributes | |
readonly AstarPath | astar |
bool | queuedWorkItemFloodFill = false |
True if any work items have queued a flood fill. | |
readonly IndexedQueue < AstarWorkItem > | workItems = new IndexedQueue<AstarWorkItem>() |
bool | workItemsInProgressRightNow = false |
Used to prevent waiting for work items to complete inside other work items as that will cause the program to hang. | |
WorkItemProcessor | ( | AstarPath | astar | ) |
void AddWorkItem | ( | AstarWorkItem | itm | ) |
Add a work item to be processed when pathfinding is paused.
void EnsureValidFloodFill | ( | ) |
If a WorkItem needs to have a valid flood fill during execution, call this method to ensure there are no pending flood fills.
void OnFloodFill | ( | ) |
bool ProcessWorkItems | ( | bool | force | ) |
Process graph updating work items.
Process all queued work items, e.g graph updates and the likes.
|
private |
Call during work items to queue a flood fill.
An instant flood fill can be done via FloodFill() but this method can be used to batch several updates into one to increase performance. WorkItems which require a valid Flood Fill in their execution can call EnsureValidFloodFill to ensure that a flood fill is done if any earlier work items queued one.
Once a flood fill is queued it will be done after all WorkItems have been executed.
|
private |
|
private |
True if any work items have queued a flood fill.
|
private |
|
private |
Used to prevent waiting for work items to complete inside other work items as that will cause the program to hang.
|
getset |
True while a batch of work items are being processed.
Set to true when a work item is started to be processed, reset to false when all work items are complete.
Work item updates are often spread out over several frames, this flag will be true during the whole time the updates are in progress.