Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Task_SetPosition.h
Go to the documentation of this file.
1/**
2 * @file Task_SetPosition.h
3 * @brief Atomic task that sets the entity's position.
4 * @author Olympe Engine
5 * @date 2026-03-08
6 *
7 * @details
8 * Task_SetPosition teleports an entity to a specified position.
9 *
10 * Parameters (ParameterMap):
11 * "Target" (Vector) — destination position (required).
12 *
13 * World mode (ctx.ComponentFacade with Position set):
14 * Writes directly to the entity's PositionComponent.
15 *
16 * Headless mode (ComponentFacade is nullptr or Position is null):
17 * Writes to "local:Position" in ctx.LocalBB.
18 *
19 * Returns:
20 * Success after writing the position.
21 * Failure if "Target" is missing.
22 *
23 * C++14 compliant - no C++17/20 features.
24 */
25
26#pragma once
27
28#include "../../IAtomicTask.h"
29
30namespace Olympe {
31
32/**
33 * @class Task_SetPosition
34 * @brief Sets entity position via ECS or LocalBlackboard.
35 */
37public:
39
41 const ParameterMap& params) override;
42
43 TaskStatus Execute(const ParameterMap& params) override;
44
45 void Abort() override;
46};
47
48} // 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
Sets entity position via ECS or LocalBlackboard.
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().