![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Abstract interface for a single atomic unit of work. More...
#include <IAtomicTask.h>
Inheritance diagram for Olympe::IAtomicTask:Public Types | |
| using | ParameterMap = std::unordered_map< std::string, TaskValue > |
| Convenience alias for the parameter map passed to Execute(). | |
Public Member Functions | |
| virtual | ~IAtomicTask ()=default |
| virtual TaskStatus | Execute (const ParameterMap ¶ms)=0 |
| Executes the atomic task for one frame. | |
| virtual TaskStatus | ExecuteWithContext (const AtomicTaskContext &ctx, const ParameterMap ¶ms) |
| Executes the atomic task for one frame with full runtime context. | |
| virtual void | Abort ()=0 |
| Aborts the task, releasing any in-progress state. | |
Abstract interface for a single atomic unit of work.
Implement Execute() to perform the task logic and Abort() to release any resources or state when the task is interrupted before completion. Tasks receive their parameters as a map of TaskValue instances keyed by parameter name.
Example:
Definition at line 63 of file IAtomicTask.h.
| using Olympe::IAtomicTask::ParameterMap = std::unordered_map<std::string, TaskValue> |
Convenience alias for the parameter map passed to Execute().
Definition at line 67 of file IAtomicTask.h.
|
virtualdefault |
Aborts the task, releasing any in-progress state.
Called by the TaskSystem when execution is interrupted (e.g. a parent node is aborted or a new graph is bound while a task is Running). Concrete tasks must implement this to clean up timers, reservations, animations, or any other side-effects started in Execute().
Implemented in Olympe::Task_ChangeState, Olympe::Task_Flee, Olympe::Task_GotoPosition, Olympe::Task_RequestPathfinding, Olympe::Task_SetAnimation, Olympe::Task_Compare, Olympe::Task_SetVariable, Olympe::Task_Attack, Olympe::Task_Flee, Olympe::Task_MoveToLocation, Olympe::Task_PlayAnimation, Olympe::Task_SetSprite, Olympe::Task_ChangeState, Olympe::Task_GetDeltaTime, Olympe::Task_GetWorldInstance, Olympe::Task_SetPosition, Olympe::Task_LogMessage, and Olympe::Task_Wait.
|
pure virtual |
Executes the atomic task for one frame.
| params | Named parameters provided by the task graph node. |
Implemented in Olympe::Task_ChangeState, Olympe::Task_Flee, Olympe::Task_GotoPosition, Olympe::Task_RequestPathfinding, Olympe::Task_SetAnimation, Olympe::Task_Compare, Olympe::Task_SetVariable, Olympe::Task_Attack, Olympe::Task_Flee, Olympe::Task_MoveToLocation, Olympe::Task_PlayAnimation, Olympe::Task_SetSprite, Olympe::Task_ChangeState, Olympe::Task_GetDeltaTime, Olympe::Task_GetWorldInstance, Olympe::Task_SetPosition, Olympe::Task_LogMessage, and Olympe::Task_Wait.
Referenced by ExecuteWithContext().
Here is the caller graph for this function:
|
inlinevirtual |
Executes the atomic task for one frame with full runtime context.
New tasks should override this method to access the richer context (World pointer, LocalBlackboard, EntityID, dt, StateTimer). The default implementation simply forwards to Execute(params) so all existing tasks remain compatible without any changes.
| ctx | Runtime context for this tick (Entity, World*, LocalBB, dt, StateTimer). |
| params | Named parameters provided by the task graph node. |
Reimplemented in Olympe::Task_ChangeState, Olympe::Task_Flee, Olympe::Task_GotoPosition, Olympe::Task_RequestPathfinding, Olympe::Task_SetAnimation, Olympe::Task_Compare, Olympe::Task_SetVariable, Olympe::Task_Attack, Olympe::Task_Flee, Olympe::Task_MoveToLocation, Olympe::Task_PlayAnimation, Olympe::Task_SetSprite, Olympe::Task_ChangeState, Olympe::Task_GetDeltaTime, Olympe::Task_GetWorldInstance, Olympe::Task_SetPosition, and Olympe::Task_Wait.
Definition at line 93 of file IAtomicTask.h.
References Execute(), and GetComponentTypeID_Static().
Here is the call graph for this function: