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

Registry for BT-accessible event types loaded from JSON configuration Mirrors BTNodeRegistry pattern for consistency. More...

#include <BTEventTypeRegistry.h>

Classes

struct  EventTypeEntry
 Event type entry from JSON configuration. More...
 

Static Public Member Functions

static bool Initialize (const std::string &filepath)
 Initialize registry from JSON file with fallback.
 
static const std::vector< EventTypeEntry > & GetAllEventTypes ()
 Get all registered event types.
 
static const EventTypeEntryGetEventTypeEntry (const std::string &id)
 Get event type entry by id.
 
static std::string GetDisplayName (const std::string &id)
 Get display name for event type id.
 
static std::string GetDomain (const std::string &id)
 Get domain for event type id.
 
static std::string GetCategory (const std::string &id)
 Get category for event type id.
 
static std::vector< EventTypeEntryGetEventTypesByCategory (const std::string &category)
 Get all event types for a specific category.
 
static std::vector< std::string > GetAllCategories ()
 Get all unique categories.
 
static bool Reload (const std::string &filepath)
 Reload registry from file (for live editing)
 
static bool IsValid (const std::string &id)
 Check if event type is registered.
 

Static Private Member Functions

static bool LoadFromJSON (const std::string &filepath)
 Load event types from JSON file.
 
static void InitializeDefaults ()
 Initialize default hardcoded event types (fallback)
 

Static Private Attributes

static std::vector< EventTypeEntrys_eventTypes
 
static std::map< std::string, size_ts_eventTypeMap
 
static bool s_initialized = false
 

Detailed Description

Registry for BT-accessible event types loaded from JSON configuration Mirrors BTNodeRegistry pattern for consistency.

Definition at line 17 of file BTEventTypeRegistry.h.

Member Function Documentation

◆ GetAllCategories()

std::vector< std::string > BTEventTypeRegistry::GetAllCategories ( )
static

Get all unique categories.

Definition at line 178 of file BTEventTypeRegistry.cpp.

References GetAllEventTypes(), and GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetAllEventTypes()

const std::vector< BTEventTypeRegistry::EventTypeEntry > & BTEventTypeRegistry::GetAllEventTypes ( )
static

Get all registered event types.

Definition at line 123 of file BTEventTypeRegistry.cpp.

References Initialize(), s_eventTypes, and s_initialized.

Referenced by GetAllCategories(), and GetEventTypesByCategory().

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

◆ GetCategory()

std::string BTEventTypeRegistry::GetCategory ( const std::string &  id)
static

Get category for event type id.

Definition at line 159 of file BTEventTypeRegistry.cpp.

References GetComponentTypeID_Static(), and GetEventTypeEntry().

+ Here is the call graph for this function:

◆ GetDisplayName()

std::string BTEventTypeRegistry::GetDisplayName ( const std::string &  id)
static

Get display name for event type id.

Definition at line 147 of file BTEventTypeRegistry.cpp.

References GetComponentTypeID_Static(), and GetEventTypeEntry().

+ Here is the call graph for this function:

◆ GetDomain()

std::string BTEventTypeRegistry::GetDomain ( const std::string &  id)
static

Get domain for event type id.

Definition at line 153 of file BTEventTypeRegistry.cpp.

References GetComponentTypeID_Static(), and GetEventTypeEntry().

+ Here is the call graph for this function:

◆ GetEventTypeEntry()

const BTEventTypeRegistry::EventTypeEntry * BTEventTypeRegistry::GetEventTypeEntry ( const std::string &  id)
static

Get event type entry by id.

Parameters
idEvent type identifier (e.g., "Olympe_EventType_AI_Explosion")
Returns
pointer to entry, nullptr if not found

Definition at line 132 of file BTEventTypeRegistry.cpp.

References GetComponentTypeID_Static(), Initialize(), s_eventTypeMap, s_eventTypes, and s_initialized.

Referenced by GetCategory(), GetDisplayName(), and GetDomain().

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

◆ GetEventTypesByCategory()

std::vector< BTEventTypeRegistry::EventTypeEntry > BTEventTypeRegistry::GetEventTypesByCategory ( const std::string &  category)
static

Get all event types for a specific category.

Definition at line 165 of file BTEventTypeRegistry.cpp.

References GetAllEventTypes(), and GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ Initialize()

bool BTEventTypeRegistry::Initialize ( const std::string &  filepath)
static

Initialize registry from JSON file with fallback.

Parameters
filepathPath to EventTypes.json (e.g., "./Gamedata/BehaviorTree/EventTypes.json")
Returns
true if loaded successfully (JSON or fallback)

Definition at line 11 of file BTEventTypeRegistry.cpp.

References InitializeDefaults(), LoadFromJSON(), s_eventTypes, and s_initialized.

Referenced by GetAllEventTypes(), GetEventTypeEntry(), IsValid(), and Reload().

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

◆ InitializeDefaults()

void BTEventTypeRegistry::InitializeDefaults ( )
staticprivate

Initialize default hardcoded event types (fallback)

Definition at line 89 of file BTEventTypeRegistry.cpp.

References GetComponentTypeID_Static(), s_eventTypeMap, and s_eventTypes.

Referenced by Initialize().

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

◆ IsValid()

bool BTEventTypeRegistry::IsValid ( const std::string &  id)
static

Check if event type is registered.

Definition at line 198 of file BTEventTypeRegistry.cpp.

References Initialize(), s_eventTypeMap, and s_initialized.

+ Here is the call graph for this function:

◆ LoadFromJSON()

bool BTEventTypeRegistry::LoadFromJSON ( const std::string &  filepath)
staticprivate

◆ Reload()

bool BTEventTypeRegistry::Reload ( const std::string &  filepath)
static

Reload registry from file (for live editing)

Definition at line 192 of file BTEventTypeRegistry.cpp.

References Initialize(), and s_initialized.

+ Here is the call graph for this function:

Member Data Documentation

◆ s_eventTypeMap

std::map< std::string, size_t > BTEventTypeRegistry::s_eventTypeMap
staticprivate

Definition at line 98 of file BTEventTypeRegistry.h.

Referenced by GetEventTypeEntry(), InitializeDefaults(), IsValid(), and LoadFromJSON().

◆ s_eventTypes

std::vector< BTEventTypeRegistry::EventTypeEntry > BTEventTypeRegistry::s_eventTypes
staticprivate

◆ s_initialized

bool BTEventTypeRegistry::s_initialized = false
staticprivate

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