◆ WorkItemProcessor()
◆ AddWorkItem()
Add a work item to be processed when pathfinding is paused.
- See also
- ProcessWorkItems
◆ EnsureValidFloodFill()
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.
Implements IWorkItemContext.
◆ OnFloodFill()
◆ ProcessWorkItems()
bool ProcessWorkItems |
( |
bool |
force | ) |
|
Process graph updating work items.
Process all queued work items, e.g graph updates and the likes.
- Returns
- false if there are still items to be processed.
- true if the last work items was processed and pathfinding threads are ready to be resumed.
- See also
- AddWorkItem
-
threadSafeUpdateState
-
Update
◆ QueueFloodFill()
void IWorkItemContext. QueueFloodFill |
( |
| ) |
|
|
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.
Implements IWorkItemContext.
◆ astar
◆ queuedWorkItemFloodFill
bool queuedWorkItemFloodFill = false |
|
private |
True if any work items have queued a flood fill.
- See also
- QueueWorkItemFloodFill
◆ workItems
◆ workItemsInProgress
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.
◆ workItemsInProgressRightNow
bool workItemsInProgressRightNow |
|
getprivate set |
Used to prevent waiting for work items to complete inside other work items as that will cause the program to hang.
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Core/Misc/WorkItemProcessor.cs