Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
BTNode Struct Reference

Represents a single node in a behavior tree. More...

#include <BehaviorTree.h>

Public Member Functions

std::string GetParameterString (const std::string &key, const std::string &defaultValue="") const
 
int GetParameterInt (const std::string &key, int defaultValue=0) const
 
float GetParameterFloat (const std::string &key, float defaultValue=0.0f) const
 

Public Attributes

BTNodeType type = BTNodeType::Action
 Node type.
 
uint32_t id = 0
 Unique node ID within tree.
 
std::vector< uint32_tchildIds
 IDs of child nodes.
 
BTConditionType conditionType = BTConditionType::TargetVisible
 Condition type (enum)
 
std::string conditionTypeString
 Condition type as string (for flexible conditions like CheckBlackboardValue)
 
float conditionParam = 0.0f
 Generic parameter for conditions.
 
BTActionType actionType = BTActionType::Idle
 Action type.
 
float actionParam1 = 0.0f
 Generic parameter 1 for actions.
 
float actionParam2 = 0.0f
 Generic parameter 2 for actions.
 
uint32_t decoratorChildId = 0
 
int repeatCount = 1
 
std::string name
 
std::map< std::string, std::string > stringParams
 String parameters.
 
std::map< std::string, intintParams
 Integer parameters.
 
std::map< std::string, floatfloatParams
 Float parameters.
 

Detailed Description

Represents a single node in a behavior tree.

Can be a composite, decorator, condition, or action node. Stores node type, parameters, and child references.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 133 of file BehaviorTree.h.

Member Function Documentation

◆ GetParameterFloat()

float BTNode::GetParameterFloat ( const std::string &  key,
float  defaultValue = 0.0f 
) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 176 of file BehaviorTree.h.

References floatParams, and GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetParameterInt()

int BTNode::GetParameterInt ( const std::string &  key,
int  defaultValue = 0 
) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 170 of file BehaviorTree.h.

References GetComponentTypeID_Static(), and intParams.

+ Here is the call graph for this function:

◆ GetParameterString()

std::string BTNode::GetParameterString ( const std::string &  key,
const std::string &  defaultValue = "" 
) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 164 of file BehaviorTree.h.

References GetComponentTypeID_Static(), and stringParams.

+ Here is the call graph for this function:

Member Data Documentation

◆ actionParam1

float BTNode::actionParam1 = 0.0f

Generic parameter 1 for actions.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 148 of file BehaviorTree.h.

◆ actionParam2

float BTNode::actionParam2 = 0.0f

Generic parameter 2 for actions.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 149 of file BehaviorTree.h.

◆ actionType

BTActionType BTNode::actionType = BTActionType::Idle

◆ childIds

std::vector<uint32_t> BTNode::childIds

◆ conditionParam

float BTNode::conditionParam = 0.0f

Generic parameter for conditions.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 144 of file BehaviorTree.h.

◆ conditionType

◆ conditionTypeString

std::string BTNode::conditionTypeString

Condition type as string (for flexible conditions like CheckBlackboardValue)

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 143 of file BehaviorTree.h.

◆ decoratorChildId

uint32_t BTNode::decoratorChildId = 0

◆ floatParams

std::map<std::string, float> BTNode::floatParams

Float parameters.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 161 of file BehaviorTree.h.

Referenced by GetParameterFloat().

◆ id

uint32_t BTNode::id = 0

Unique node ID within tree.

Definition at line 136 of file BehaviorTree.h.

Referenced by Olympe::BehaviorTreeDebugWindow::CreateFromTemplate(), and BehaviorTreeManager::LoadTreeFromFile().

◆ intParams

std::map<std::string, int> BTNode::intParams

Integer parameters.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 160 of file BehaviorTree.h.

Referenced by GetParameterInt().

◆ name

std::string BTNode::name

◆ repeatCount

int BTNode::repeatCount = 1

◆ stringParams

std::map<std::string, std::string> BTNode::stringParams

◆ type


The documentation for this struct was generated from the following file: