Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Task_Compare.h
Go to the documentation of this file.
1/**
2 * @file Task_Compare.h
3 * @brief Atomic task that compares two values and returns Success or Failure.
4 * @author Olympe Engine
5 * @date 2026-02-23
6 *
7 * @details
8 * Task_Compare evaluates a comparison between "LHS" and "RHS" parameters
9 * using the "Operator" parameter and returns Success if the comparison is
10 * true, Failure otherwise.
11 *
12 * Parameters (ParameterMap):
13 * "LHS" (Int|Float|String) - left-hand side value (required)
14 * "RHS" (Int|Float|String) - right-hand side value (required, same type)
15 * "Operator" (String) - one of: "==", "!=", "<", ">", "<=", ">="
16 * (required; "<","<=",">",">=" numeric only)
17 *
18 * Returns:
19 * Success if the comparison is true.
20 * Failure if the comparison is false, or if parameters are invalid.
21 *
22 * C++14 compliant - no C++17/20 features.
23 */
24
25#pragma once
26
27#include "../../IAtomicTask.h"
28
29namespace Olympe {
30
31/**
32 * @class Task_Compare
33 * @brief Atomic task that returns Success if a comparison holds, Failure otherwise.
34 */
35class Task_Compare : public IAtomicTask {
36public:
38
40 const ParameterMap& params) override;
41
42 TaskStatus Execute(const ParameterMap& params) override;
43
44 void Abort() override;
45};
46
47} // 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 returns Success if a comparison holds, Failure otherwise.
TaskStatus Execute(const ParameterMap &params) override
Executes the atomic task for one frame.
void Abort() override
Aborts the task, releasing any in-progress state.
TaskStatus ExecuteWithContext(const AtomicTaskContext &ctx, const ParameterMap &params) override
Executes the atomic task for one frame with full runtime context.
< Provides AssetID and INVALID_ASSET_ID
TaskStatus
Result code returned by IAtomicTask::Execute().
Definition IAtomicTask.h:38
Lightweight context bundle passed to IAtomicTask::ExecuteWithContext().