Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
Olympe::TaskRunnerComponent Struct Reference

Per-entity runtime state for task graph execution. More...

#include <TaskRunnerComponent.h>

Public Types

enum class  TaskStatus : uint8_t { Success , Failure , Running , Aborted }
 Possible outcomes of a task node execution. More...
 

Public Member Functions

 TaskRunnerComponent ()
 
 ~TaskRunnerComponent ()
 
 TaskRunnerComponent (TaskRunnerComponent &&)=default
 
TaskRunnerComponentoperator= (TaskRunnerComponent &&)=default
 
 TaskRunnerComponent (const TaskRunnerComponent &)=delete
 
TaskRunnerComponentoperator= (const TaskRunnerComponent &)=delete
 

Public Attributes

AssetID GraphTemplateID = INVALID_ASSET_ID
 AssetID of the TaskGraphTemplate driving this runner.
 
std::string graphAssetPath
 Path to the ATS Visual Script JSON asset file (.json).
 
int32_t CurrentNodeID = NODE_INDEX_NONE
 ID of the currently active node.
 
float StateTimer = 0.0f
 Accumulated time (in seconds) spent in the current node state.
 
std::unordered_map< std::string, Olympe::TaskValueLocalBlackboard
 Typed local blackboard for per-entity state.
 
TaskStatus LastStatus = TaskStatus::Success
 Status returned by the last completed node execution.
 
std::unique_ptr< IAtomicTaskactiveTask
 Owning pointer to the IAtomicTask instance that is currently executing for this runner.
 
std::string ActiveExecPinName
 Name of the active exec pin on the current node (e.g. "Then", "Else", "Loop").
 
int32_t SequenceChildIndex = 0
 For VSSequence: index of the next child to execute.
 
std::unordered_map< int32_t, boolDoOnceFlags
 Per-node "already fired" flag for DoOnce nodes (key = nodeID).
 
std::unordered_map< std::string, Olympe::TaskValueDataPinCache
 Frame-local cache of computed data pin values (key = "nodeID:pinName").
 

Detailed Description

Per-entity runtime state for task graph execution.

Fields:

Note
TaskRunnerComponent is move-only because activeTask is a unique_ptr.

Definition at line 56 of file TaskRunnerComponent.h.

Member Enumeration Documentation

◆ TaskStatus

Possible outcomes of a task node execution.

Enumerator
Success 

The node completed successfully.

Failure 

The node failed.

Running 

The node is still executing (will be called again next frame).

Aborted 

Execution was interrupted externally.

Definition at line 66 of file TaskRunnerComponent.h.

Constructor & Destructor Documentation

◆ TaskRunnerComponent() [1/3]

Olympe::TaskRunnerComponent::TaskRunnerComponent ( )
default

◆ ~TaskRunnerComponent()

Olympe::TaskRunnerComponent::~TaskRunnerComponent ( )
default

◆ TaskRunnerComponent() [2/3]

Olympe::TaskRunnerComponent::TaskRunnerComponent ( TaskRunnerComponent &&  )
default

◆ TaskRunnerComponent() [3/3]

Olympe::TaskRunnerComponent::TaskRunnerComponent ( const TaskRunnerComponent )
delete

Member Function Documentation

◆ operator=() [1/2]

TaskRunnerComponent & Olympe::TaskRunnerComponent::operator= ( const TaskRunnerComponent )
delete

◆ operator=() [2/2]

TaskRunnerComponent & Olympe::TaskRunnerComponent::operator= ( TaskRunnerComponent &&  )
default

Member Data Documentation

◆ ActiveExecPinName

std::string Olympe::TaskRunnerComponent::ActiveExecPinName

Name of the active exec pin on the current node (e.g. "Then", "Else", "Loop").

Definition at line 108 of file TaskRunnerComponent.h.

◆ activeTask

std::unique_ptr<IAtomicTask> Olympe::TaskRunnerComponent::activeTask

Owning pointer to the IAtomicTask instance that is currently executing for this runner.

nullptr when no task is in flight. Persisted across frames so that tasks returning Running are re-ticked on the next Process() call. Replaced (old task Abort()ed) when the system advances to a different node.

Definition at line 105 of file TaskRunnerComponent.h.

◆ CurrentNodeID

int32_t Olympe::TaskRunnerComponent::CurrentNodeID = NODE_INDEX_NONE

ID of the currently active node.

Definition at line 89 of file TaskRunnerComponent.h.

Referenced by Olympe::VSGraphExecutor::HandleSubGraph().

◆ DataPinCache

std::unordered_map<std::string, Olympe::TaskValue> Olympe::TaskRunnerComponent::DataPinCache

Frame-local cache of computed data pin values (key = "nodeID:pinName").

Definition at line 117 of file TaskRunnerComponent.h.

◆ DoOnceFlags

std::unordered_map<int32_t, bool> Olympe::TaskRunnerComponent::DoOnceFlags

Per-node "already fired" flag for DoOnce nodes (key = nodeID).

Definition at line 114 of file TaskRunnerComponent.h.

◆ graphAssetPath

std::string Olympe::TaskRunnerComponent::graphAssetPath

Path to the ATS Visual Script JSON asset file (.json).

When set, TaskSystem can load the template from this path via TaskGraphLoader::LoadFromFile() if GraphTemplateID is not yet resolved by AssetManager.

Definition at line 86 of file TaskRunnerComponent.h.

◆ GraphTemplateID

AssetID Olympe::TaskRunnerComponent::GraphTemplateID = INVALID_ASSET_ID

AssetID of the TaskGraphTemplate driving this runner.

Set to INVALID_ASSET_ID when no template is bound.

Definition at line 80 of file TaskRunnerComponent.h.

◆ LastStatus

TaskStatus Olympe::TaskRunnerComponent::LastStatus = TaskStatus::Success

Status returned by the last completed node execution.

Definition at line 98 of file TaskRunnerComponent.h.

◆ LocalBlackboard

std::unordered_map<std::string, Olympe::TaskValue> Olympe::TaskRunnerComponent::LocalBlackboard

Typed local blackboard for per-entity state.

Definition at line 95 of file TaskRunnerComponent.h.

◆ SequenceChildIndex

int32_t Olympe::TaskRunnerComponent::SequenceChildIndex = 0

For VSSequence: index of the next child to execute.

Definition at line 111 of file TaskRunnerComponent.h.

◆ StateTimer

float Olympe::TaskRunnerComponent::StateTimer = 0.0f

Accumulated time (in seconds) spent in the current node state.

Definition at line 92 of file TaskRunnerComponent.h.


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