Olympe Engine
2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Source
TaskSystem
AtomicTasks
Movement
Task_MoveToLocation.h
Go to the documentation of this file.
1
/**
2
* @file Task_MoveToLocation.h
3
* @brief Atomic task that moves an entity toward a target location.
4
* @author Olympe Engine
5
* @date 2026-02-23
6
*
7
* @details
8
* Task_MoveToLocation moves an entity toward a specified target position.
9
* It operates in dual mode:
10
* - World mode : if ctx.WorldPtr is set and the entity has a position
11
* component, that component is read and updated directly.
12
* - Headless mode: reads and writes the "Position" key in ctx.LocalBB,
13
* integrating position analytically using ctx.DeltaTime.
14
*
15
* Parameters (ParameterMap):
16
* "Target" (Vector) - destination position (required)
17
* "Speed" (Float) - units per second (optional, default 100.0)
18
*
19
* Returns:
20
* Running while the entity is more than a small tolerance from Target.
21
* Success once the entity reaches the target (or snaps to it on the
22
* final step).
23
* Failure if the "Position" BB key is missing in headless mode.
24
*
25
* C++14 compliant - no C++17/20 features.
26
*/
27
28
#pragma once
29
30
#include "../../IAtomicTask.h"
31
32
namespace
Olympe
{
33
34
/**
35
* @class Task_MoveToLocation
36
* @brief Moves an entity toward a target location each tick.
37
*/
38
class
Task_MoveToLocation
:
public
IAtomicTask
{
39
public
:
40
Task_MoveToLocation
();
41
42
TaskStatus
ExecuteWithContext
(
const
AtomicTaskContext
&
ctx
,
43
const
ParameterMap
&
params
)
override
;
44
45
TaskStatus
Execute
(
const
ParameterMap
&
params
)
override
;
46
47
void
Abort
()
override
;
48
};
49
50
}
// namespace Olympe
GetComponentTypeID_Static
ComponentTypeID GetComponentTypeID_Static()
Definition
ECS_Entity.h:56
Olympe::IAtomicTask
Abstract interface for a single atomic unit of work.
Definition
IAtomicTask.h:63
Olympe::IAtomicTask::ParameterMap
std::unordered_map< std::string, TaskValue > ParameterMap
Convenience alias for the parameter map passed to Execute().
Definition
IAtomicTask.h:67
Olympe::Task_MoveToLocation
Moves an entity toward a target location each tick.
Definition
Task_MoveToLocation.h:38
Olympe::Task_MoveToLocation::Abort
void Abort() override
Aborts the task, releasing any in-progress state.
Definition
Task_MoveToLocation.cpp:48
Olympe::Task_MoveToLocation::Task_MoveToLocation
Task_MoveToLocation()
Definition
Task_MoveToLocation.cpp:46
Olympe::Task_MoveToLocation::ExecuteWithContext
TaskStatus ExecuteWithContext(const AtomicTaskContext &ctx, const ParameterMap ¶ms) override
Executes the atomic task for one frame with full runtime context.
Definition
Task_MoveToLocation.cpp:66
Olympe::Task_MoveToLocation::Execute
TaskStatus Execute(const ParameterMap ¶ms) override
Executes the atomic task for one frame.
Definition
Task_MoveToLocation.cpp:57
Olympe
< Provides AssetID and INVALID_ASSET_ID
Definition
BTEditorCommand.cpp:16
Olympe::TaskStatus
TaskStatus
Result code returned by IAtomicTask::Execute().
Definition
IAtomicTask.h:38
Olympe::AtomicTaskContext
Lightweight context bundle passed to IAtomicTask::ExecuteWithContext().
Definition
AtomicTaskContext.h:36
Generated on Mon Apr 13 2026 08:15:20 for Olympe Engine by
1.9.8