Navigation
API > API/Runtime > API/Runtime/MovieScene > API/Runtime/MovieScene/TEntityTaskComponents
Description
Dispatch a task for every allocation that matches the filters and component types. Must be explicitly instantiated with the task type to dispatch. Construction arguments are deduced. Tasks must implement a ForEachAllocation function that matches this task's component accessor types.
For example: struct FForEachAllocation { void ForEachAllocation(FEntityAllocation* InAllocation, const TFilteredEntityTask< FEntityIDAccess, TRead
TComponentTypeID
FGraphEventRef Task = FEntityTaskBuilder() .ReadEntityIDs() .Read(FloatChannelComponent) .SetStat(GET_STATID(MyStatName)) .SetDesiredThread(ENamedThreads::AnyThread) .Dispatch_PerAllocation
| Name | Dispatch_PerAllocation |
| Type | function |
| Header File | /Engine/Source/Runtime/MovieScene/Public/EntitySystem/MovieSceneEntitySystemTask.h |
| Include Path | #include "EntitySystem/MovieSceneEntitySystemTask.h" |
template<typename TaskImpl, typename... TaskConstructionArgs>
FGraphEventRef Dispatch_PerAllocation
(
FEntityManager * EntityManager,
const FSystemTaskPrerequisites & Prerequisites,
FSystemSubsequentTasks * Subsequents,
TaskConstructionArgs &&... InArgs
) const
A pointer to the graph event for the task, or nullptr if this task is not valid (ie contains invalid component types that would be necessary for the task to run), or threading is disabled
Parameters
| Name | Remarks |
|---|---|
| EntityManager | The entity manager to run the task on. All component types must relate to this entity manager. |
| Prerequisites | Prerequisite tasks that must run before this one |
| Subsequents | (Optional) Subsequent task tracking that this task should be added to for each writable component type |
| InArgs | Optional arguments that are forwarded to the constructor of TaskImpl |