11#include "../../AtomicTaskRegistry.h"
12#include "../../LocalBlackboard.h"
13#include "../../../system/system_utils.h"
37 SYSTEM_LOG <<
"[Task_Attack] No LocalBlackboard in context\n";
47 damage =
it->second.AsFloat();
57 range =
it->second.AsFloat();
72 <<
" attacks target=" << target
73 <<
" damage=" << damage
74 <<
" range=" << range <<
"\n";
#define REGISTER_ATOMIC_TASK(ClassName, Id)
Registers a factory for ClassName under Id at static init time.
ComponentTypeID GetComponentTypeID_Static()
const EntityID INVALID_ENTITY_ID
Atomic task that performs a melee/ranged attack on a target entity.
std::unordered_map< std::string, TaskValue > ParameterMap
Convenience alias for the parameter map passed to Execute().
C++14-compliant type-safe value container for task parameters.
EntityID AsEntityID() const
Returns the EntityID value.
Initiates an attack action on the current target entity.
TaskStatus Execute(const ParameterMap ¶ms) 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 ¶ms) override
Executes the atomic task for one frame with full runtime context.
< Provides AssetID and INVALID_ASSET_ID
@ Float
Single-precision float.
@ EntityID
Entity identifier (uint64_t)
TaskStatus
Result code returned by IAtomicTask::Execute().
@ Success
Task completed successfully.
static const float DEFAULT_RANGE
static const float DEFAULT_DAMAGE
Lightweight context bundle passed to IAtomicTask::ExecuteWithContext().