11#include "../../AtomicTaskRegistry.h"
12#include "../../LocalBlackboard.h"
13#include "../../../system/system_utils.h"
30 const ParameterMap&
params)
34 SYSTEM_LOG <<
"[Task_ChangeState] No LocalBlackboard in context\n";
44 SYSTEM_LOG <<
"[Task_ChangeState] Missing or invalid 'NewState' parameter\n";
51 const TaskValue
currentVal =
ctx.LocalBB->GetValueScoped(
"local:CurrentState");
61 <<
" setting state to '" <<
newState <<
"'\n";
65 ctx.LocalBB->SetValueScoped(
"local:CurrentState", TaskValue(
newState));
#define REGISTER_ATOMIC_TASK(ClassName, Id)
Registers a factory for ClassName under Id at static init time.
ComponentTypeID GetComponentTypeID_Static()
Atomic task that changes the AI state stored in the LocalBlackboard.
TaskStatus Execute(const ParameterMap ¶ms) override
Executes the atomic task for one frame.
TaskStatus ExecuteWithContext(const AtomicTaskContext &ctx, const ParameterMap ¶ms) override
Executes the atomic task for one frame with full runtime context.
void Abort() override
Aborts the task, releasing any in-progress state.
< Provides AssetID and INVALID_ASSET_ID
TaskStatus
Result code returned by IAtomicTask::Execute().
@ Success
Task completed successfully.