Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Task_Attack.h
Go to the documentation of this file.
1/**
2 * @file Task_Attack.h
3 * @brief Atomic task that performs a melee/ranged attack on a target entity.
4 * @author Olympe Engine
5 * @date 2026-03-08
6 *
7 * @details
8 * Task_Attack reads the current target EntityID from "local:Target" in
9 * the LocalBlackboard, then logs the attack with the resolved damage and
10 * range values. The actual damage application is handled by the combat
11 * system; this task only initiates and logs the action.
12 *
13 * Parameters (ParameterMap):
14 * "Damage" (Float) — damage amount (optional, default 10.0).
15 * "Range" (Float) — maximum attack range in units (optional, default 50.0).
16 *
17 * Returns:
18 * Success after performing the attack action.
19 * Failure if ctx.LocalBB is null.
20 *
21 * C++14 compliant - no C++17/20 features.
22 */
23
24#pragma once
25
26#include "../../IAtomicTask.h"
27
28namespace Olympe {
29
30/**
31 * @class Task_Attack
32 * @brief Initiates an attack action on the current target entity.
33 */
34class Task_Attack : public IAtomicTask {
35public:
37
39 const ParameterMap& params) override;
40
41 TaskStatus Execute(const ParameterMap& params) override;
42
43 void Abort() override;
44};
45
46} // 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
Initiates an attack action on the current target entity.
Definition Task_Attack.h:34
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().