Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Olympe::AI::BTNodeRegistry Class Reference

Singleton registry for all BT node types. More...

#include <BTNodeRegistry.h>

Public Member Functions

void RegisterNodeType (const BTNodeTypeInfo &info)
 Register a new node type.
 
const BTNodeTypeInfoGetNodeTypeInfo (const std::string &typeName) const
 Get metadata for a node type.
 
std::vector< std::string > GetAllNodeTypes () const
 Get all registered node type names.
 
std::vector< std::string > GetNodeTypesByCategory (BTNodeCategory category) const
 Get node types in a specific category.
 
bool IsValidNodeType (const std::string &typeName) const
 Check if a node type exists.
 
bool CanHaveChildren (const std::string &typeName) const
 Check if a node type can have children.
 
int GetMinChildren (const std::string &typeName) const
 Get minimum number of children for a node type.
 
int GetMaxChildren (const std::string &typeName) const
 Get maximum number of children for a node type.
 

Static Public Member Functions

static BTNodeRegistryGet ()
 Get singleton instance.
 

Private Member Functions

 BTNodeRegistry ()
 
 ~BTNodeRegistry ()=default
 
 BTNodeRegistry (const BTNodeRegistry &)=delete
 
BTNodeRegistryoperator= (const BTNodeRegistry &)=delete
 
void InitializeBuiltInTypes ()
 Initialize all built-in BT node types.
 

Private Attributes

std::map< std::string, BTNodeTypeInfom_nodeTypes
 

Detailed Description

Singleton registry for all BT node types.

Manages metadata for all behavior tree node types. Automatically initializes built-in types on first access. Provides queries by type name or category.

Definition at line 59 of file BTNodeRegistry.h.

Constructor & Destructor Documentation

◆ BTNodeRegistry() [1/2]

Olympe::AI::BTNodeRegistry::BTNodeRegistry ( )
private

Definition at line 29 of file BTNodeRegistry.cpp.

References InitializeBuiltInTypes().

+ Here is the call graph for this function:

◆ ~BTNodeRegistry()

Olympe::AI::BTNodeRegistry::~BTNodeRegistry ( )
privatedefault

◆ BTNodeRegistry() [2/2]

Olympe::AI::BTNodeRegistry::BTNodeRegistry ( const BTNodeRegistry )
privatedelete

Member Function Documentation

◆ CanHaveChildren()

bool Olympe::AI::BTNodeRegistry::CanHaveChildren ( const std::string &  typeName) const

Check if a node type can have children.

Parameters
typeNameType name to check
Returns
true if it can have children

Definition at line 464 of file BTNodeRegistry.cpp.

References GetComponentTypeID_Static(), and GetNodeTypeInfo().

+ Here is the call graph for this function:

◆ Get()

BTNodeRegistry & Olympe::AI::BTNodeRegistry::Get ( )
static

◆ GetAllNodeTypes()

std::vector< std::string > Olympe::AI::BTNodeRegistry::GetAllNodeTypes ( ) const

Get all registered node type names.

Returns
Vector of type names

Definition at line 437 of file BTNodeRegistry.cpp.

References GetComponentTypeID_Static(), and m_nodeTypes.

+ Here is the call graph for this function:

◆ GetMaxChildren()

int Olympe::AI::BTNodeRegistry::GetMaxChildren ( const std::string &  typeName) const

Get maximum number of children for a node type.

Parameters
typeNameType name to query
Returns
Maximum children count (-1 = no limit)

Definition at line 482 of file BTNodeRegistry.cpp.

References GetComponentTypeID_Static(), and GetNodeTypeInfo().

+ Here is the call graph for this function:

◆ GetMinChildren()

int Olympe::AI::BTNodeRegistry::GetMinChildren ( const std::string &  typeName) const

Get minimum number of children for a node type.

Parameters
typeNameType name to query
Returns
Minimum children count (-1 = no limit)

Definition at line 473 of file BTNodeRegistry.cpp.

References GetComponentTypeID_Static(), and GetNodeTypeInfo().

+ Here is the call graph for this function:

◆ GetNodeTypeInfo()

const BTNodeTypeInfo * Olympe::AI::BTNodeRegistry::GetNodeTypeInfo ( const std::string &  typeName) const

Get metadata for a node type.

Parameters
typeNameNode type identifier
Returns
Pointer to metadata or nullptr if not found

Definition at line 432 of file BTNodeRegistry.cpp.

References GetComponentTypeID_Static(), and m_nodeTypes.

Referenced by CanHaveChildren(), GetMaxChildren(), and GetMinChildren().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNodeTypesByCategory()

std::vector< std::string > Olympe::AI::BTNodeRegistry::GetNodeTypesByCategory ( BTNodeCategory  category) const

Get node types in a specific category.

Parameters
categoryCategory to filter by
Returns
Vector of type names in the category

Definition at line 448 of file BTNodeRegistry.cpp.

References GetComponentTypeID_Static(), and m_nodeTypes.

+ Here is the call graph for this function:

◆ InitializeBuiltInTypes()

void Olympe::AI::BTNodeRegistry::InitializeBuiltInTypes ( )
private

◆ IsValidNodeType()

bool Olympe::AI::BTNodeRegistry::IsValidNodeType ( const std::string &  typeName) const

Check if a node type exists.

Parameters
typeNameType name to check
Returns
true if registered, false otherwise

Definition at line 460 of file BTNodeRegistry.cpp.

References m_nodeTypes.

◆ operator=()

BTNodeRegistry & Olympe::AI::BTNodeRegistry::operator= ( const BTNodeRegistry )
privatedelete

◆ RegisterNodeType()

void Olympe::AI::BTNodeRegistry::RegisterNodeType ( const BTNodeTypeInfo info)

Register a new node type.

Parameters
infoNode type metadata

Definition at line 428 of file BTNodeRegistry.cpp.

References GetComponentTypeID_Static(), and m_nodeTypes.

Referenced by InitializeBuiltInTypes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_nodeTypes

std::map<std::string, BTNodeTypeInfo> Olympe::AI::BTNodeRegistry::m_nodeTypes
private

The documentation for this class was generated from the following files: