Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
AtomicTaskContext.h
Go to the documentation of this file.
1/**
2 * @file AtomicTaskContext.h
3 * @brief Runtime context passed to IAtomicTask::ExecuteWithContext().
4 * @author Olympe Engine
5 * @date 2026-02-23
6 *
7 * @details
8 * AtomicTaskContext bundles the per-frame runtime data that a concrete atomic
9 * task may need without having to query singletons directly. It is built by
10 * TaskSystem::ExecuteAtomicTask() and forwarded to
11 * IAtomicTask::ExecuteWithContext() each tick.
12 *
13 * Passing nullptr for WorldPtr is valid; callers that do not have access to a
14 * live World (e.g. unit tests) simply leave it null and tasks that need the
15 * World must guard against a null pointer.
16 *
17 * C++14 compliant - no C++17/20 features.
18 */
19
20#pragma once
21
22#include "../ECS_Entity.h"
23#include "TaskWorldFacade.h"
24
25namespace Olympe {
26
27// Forward declarations - avoids pulling in heavy headers from task headers.
28class World;
29class LocalBlackboard;
30
31/**
32 * @struct AtomicTaskContext
33 * @brief Lightweight context bundle passed to IAtomicTask::ExecuteWithContext().
34 */
36{
37 /// The entity whose task graph is being executed.
39
40 /// Pointer to the active World. May be nullptr in headless / test contexts.
41 World* WorldPtr = nullptr;
42
43 /// Optional ECS component accessor populated by the driving ECS system.
44 /// When non-null and both Position and Movement members are set, tasks that
45 /// support World mode (e.g. Task_MoveToLocation) read/write these components
46 /// instead of using LocalBlackboard. May be nullptr in headless / test
47 /// contexts that do not provide ECS components.
49
50 /// Pointer to the task node's LocalBlackboard for this tick. Never nullptr.
52
53 /// Delta-time in seconds for the current frame.
54 float DeltaTime = 0.0f;
55
56 /// Time in seconds that the current task node has been running (accumulated).
57 float StateTimer = 0.0f;
58};
59
60} // namespace Olympe
std::uint64_t EntityID
Definition ECS_Entity.h:21
const EntityID INVALID_ENTITY_ID
Definition ECS_Entity.h:23
Lightweight ECS component accessor bridge for the Task System.
Simple map-based blackboard for task graph runtime state.
Core ECS manager and world coordinator.
Definition World.h:210
< Provides AssetID and INVALID_ASSET_ID
Lightweight context bundle passed to IAtomicTask::ExecuteWithContext().
float DeltaTime
Delta-time in seconds for the current frame.
EntityID Entity
The entity whose task graph is being executed.
TaskWorldFacade * ComponentFacade
Optional ECS component accessor populated by the driving ECS system.
float StateTimer
Time in seconds that the current task node has been running (accumulated).
LocalBlackboard * LocalBB
Pointer to the task node's LocalBlackboard for this tick. Never nullptr.
World * WorldPtr
Pointer to the active World. May be nullptr in headless / test contexts.
Lightweight ECS component accessor passed through AtomicTaskContext.