A* Pathfinding Project  3.8.5
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
AstarWorkItem Struct Reference

Public Member Functions

 AstarWorkItem (System.Func< bool, bool > update)
 
 AstarWorkItem (System.Func< IWorkItemContext, bool, bool > update)
 
 AstarWorkItem (System.Action init, System.Func< bool, bool > update=null)
 
 AstarWorkItem (System.Action< IWorkItemContext > init, System.Func< IWorkItemContext, bool, bool > update=null)
 

Public Attributes

System.Action init
 Init function.
 
System.Action< IWorkItemContextinitWithContext
 Init function.
 
System.Func< bool, bool > update
 Update function, called once per frame when the work item executes.
 
System.Func< IWorkItemContext,
bool, bool > 
updateWithContext
 Update function, called once per frame when the work item executes.
 

Constructor & Destructor Documentation

AstarWorkItem ( System.Func< bool, bool >  update)
AstarWorkItem ( System.Func< IWorkItemContext, bool, bool >  update)
AstarWorkItem ( System.Action  init,
System.Func< bool, bool >  update = null 
)
AstarWorkItem ( System.Action< IWorkItemContext init,
System.Func< IWorkItemContext, bool, bool >  update = null 
)

Member Data Documentation

System.Action init

Init function.

May be null if no initialization is needed. Will be called once, right before the first call to update.

System.Action<IWorkItemContext> initWithContext

Init function.

May be null if no initialization is needed. Will be called once, right before the first call to update.

A context object is sent as a parameter. This can be used to for example queue a flood fill that will be executed either when a work item calls EnsureValidFloodFill or all work items have been completed. If multiple work items are updating nodes so that they need a flood fill afterwards, using the QueueFloodFill method is preferred since then only a single flood fill needs to be performed for all of the work items instead of one per work item.

System.Func<bool, bool> update

Update function, called once per frame when the work item executes.

Takes a param force. If that is true, the work item should try to complete the whole item in one go instead of spreading it out over multiple frames.

Returns
True when the work item is completed.
System.Func<IWorkItemContext, bool, bool> updateWithContext

Update function, called once per frame when the work item executes.

Takes a param force. If that is true, the work item should try to complete the whole item in one go instead of spreading it out over multiple frames.

Returns
True when the work item is completed.

A context object is sent as a parameter. This can be used to for example queue a flood fill that will be executed either when a work item calls EnsureValidFloodFill or all work items have been completed. If multiple work items are updating nodes so that they need a flood fill afterwards, using the QueueFloodFill method is preferred since then only a single flood fill needs to be performed for all of the work items instead of one per work item.


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