Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Task_Wait.h
Go to the documentation of this file.
1/**
2 * @file Task_Wait.h
3 * @brief Atomic task that waits for a specified duration.
4 * @author Olympe Engine
5 * @date 2026-02-23
6 *
7 * @details
8 * Task_Wait returns Running until ctx.StateTimer reaches the "Duration"
9 * parameter, then returns Success.
10 *
11 * Parameters (ParameterMap):
12 * "Duration" (Float) - seconds to wait (required, > 0)
13 *
14 * Returns:
15 * Running while StateTimer < Duration.
16 * Success once StateTimer >= Duration.
17 * Failure if "Duration" parameter is missing or non-positive.
18 *
19 * C++14 compliant - no C++17/20 features.
20 */
21
22#pragma once
23
24#include "../../IAtomicTask.h"
25
26namespace Olympe {
27
28/**
29 * @class Task_Wait
30 * @brief Atomic task that idles for a fixed duration then succeeds.
31 */
32class Task_Wait : public IAtomicTask {
33public:
34 Task_Wait();
35
37 const ParameterMap& params) override;
38
39 TaskStatus Execute(const ParameterMap& params) override;
40
41 void Abort() override;
42};
43
44} // 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
Atomic task that idles for a fixed duration then succeeds.
Definition Task_Wait.h:32
TaskStatus Execute(const ParameterMap &params) override
Executes the atomic task for one frame.
Definition Task_Wait.cpp:27
void Abort() override
Aborts the task, releasing any in-progress state.
Definition Task_Wait.cpp:22
TaskStatus ExecuteWithContext(const AtomicTaskContext &ctx, const ParameterMap &params) override
Executes the atomic task for one frame with full runtime context.
Definition Task_Wait.cpp:32
< Provides AssetID and INVALID_ASSET_ID
TaskStatus
Result code returned by IAtomicTask::Execute().
Definition IAtomicTask.h:38
Lightweight context bundle passed to IAtomicTask::ExecuteWithContext().