Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Task_GetWorldInstance.h
Go to the documentation of this file.
1/**
2 * @file Task_GetWorldInstance.h
3 * @brief Atomic task that resolves a named World entity and stores its ID.
4 * @author Olympe Engine
5 * @date 2026-03-08
6 *
7 * @details
8 * Task_GetWorldInstance looks up an entity by name in the live World and
9 * stores the resulting EntityID under "local:TargetInstance" in the
10 * LocalBlackboard. When ctx.WorldPtr is null (headless / test mode) the
11 * task logs a warning and returns Failure.
12 *
13 * Parameters (ParameterMap):
14 * "InstanceName" (String) — name of the entity to locate (required).
15 *
16 * Returns:
17 * Success if the entity was found (EntityID written to LocalBB).
18 * Failure if InstanceName is missing, WorldPtr is null, or entity not found.
19 *
20 * C++14 compliant - no C++17/20 features.
21 */
22
23#pragma once
24
25#include "../../IAtomicTask.h"
26
27namespace Olympe {
28
29/**
30 * @class Task_GetWorldInstance
31 * @brief Finds an entity by name in World and stores its EntityID in LocalBB.
32 */
34public:
36
38 const ParameterMap& params) override;
39
40 TaskStatus Execute(const ParameterMap& params) override;
41
42 void Abort() override;
43};
44
45} // namespace Olympe
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
Abstract interface for a single atomic unit of work.
Definition IAtomicTask.h:63
std::unordered_map< std::string, TaskValue > ParameterMap
Convenience alias for the parameter map passed to Execute().
Definition IAtomicTask.h:67
Finds an entity by name in World and stores its EntityID in LocalBB.
TaskStatus Execute(const ParameterMap &params) override
Executes the atomic task for one frame.
TaskStatus ExecuteWithContext(const AtomicTaskContext &ctx, const ParameterMap &params) override
Executes the atomic task for one frame with full runtime context.
void Abort() override
Aborts the task, releasing any in-progress state.
< Provides AssetID and INVALID_ASSET_ID
TaskStatus
Result code returned by IAtomicTask::Execute().
Definition IAtomicTask.h:38
Lightweight context bundle passed to IAtomicTask::ExecuteWithContext().