Olympe Engine
2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Source
TaskSystem
AtomicTasks
AI
Task_ChangeState.h
Go to the documentation of this file.
1
/**
2
* @file Task_ChangeState.h
3
* @brief Atomic AI task that changes the entity's current state.
4
* @author Olympe Engine
5
* @date 2026-03-08
6
*
7
* @details
8
* Task_ChangeState writes a new state name to the "local:current_state" key
9
* in the entity's LocalBlackboard. This is the standard way for VS graphs
10
* to transition AI entities between logical states (e.g. "Idle" → "Patrolling").
11
*
12
* Parameters (ParameterMap):
13
* "StateName" (String) — target state name (required).
14
*
15
* Returns:
16
* Success after writing the new state name.
17
* Failure if "StateName" is missing or if ctx.LocalBB is null.
18
*
19
* C++14 compliant - no C++17/20 features.
20
*/
21
22
#pragma once
23
24
#include "../../IAtomicTask.h"
25
26
namespace
Olympe
{
27
28
/**
29
* @class Task_ChangeState
30
* @brief Writes a new AI state name to "local:current_state" in the LocalBlackboard.
31
*/
32
class
Task_ChangeState
:
public
IAtomicTask
{
33
public
:
34
Task_ChangeState
();
35
36
TaskStatus
ExecuteWithContext
(
const
AtomicTaskContext
&
ctx
,
37
const
ParameterMap
&
params
)
override
;
38
39
TaskStatus
Execute
(
const
ParameterMap
&
params
)
override
;
40
41
void
Abort
()
override
;
42
};
43
44
}
// namespace Olympe
GetComponentTypeID_Static
ComponentTypeID GetComponentTypeID_Static()
Definition
ECS_Entity.h:56
Olympe::IAtomicTask
Abstract interface for a single atomic unit of work.
Definition
IAtomicTask.h:63
Olympe::IAtomicTask::ParameterMap
std::unordered_map< std::string, TaskValue > ParameterMap
Convenience alias for the parameter map passed to Execute().
Definition
IAtomicTask.h:67
Olympe::Task_ChangeState
Writes a new AI state name to "local:current_state" in the LocalBlackboard.
Definition
Task_ChangeState.h:32
Olympe::Task_ChangeState::Execute
TaskStatus Execute(const ParameterMap ¶ms) override
Executes the atomic task for one frame.
Definition
Task_ChangeState.cpp:26
Olympe::Task_ChangeState::ExecuteWithContext
TaskStatus ExecuteWithContext(const AtomicTaskContext &ctx, const ParameterMap ¶ms) override
Executes the atomic task for one frame with full runtime context.
Definition
Task_ChangeState.cpp:31
Olympe::Task_ChangeState::Task_ChangeState
Task_ChangeState()
Definition
Task_ChangeState.cpp:19
Olympe::Task_ChangeState::Abort
void Abort() override
Aborts the task, releasing any in-progress state.
Definition
Task_ChangeState.cpp:21
Olympe
< Provides AssetID and INVALID_ASSET_ID
Definition
BTEditorCommand.cpp:16
Olympe::TaskStatus
TaskStatus
Result code returned by IAtomicTask::Execute().
Definition
IAtomicTask.h:38
Olympe::AtomicTaskContext
Lightweight context bundle passed to IAtomicTask::ExecuteWithContext().
Definition
AtomicTaskContext.h:36
Generated on Mon Apr 13 2026 08:15:20 for Olympe Engine by
1.9.8