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::ConditionRegistry Class Reference

Singleton registry of available condition types. More...

#include <ConditionRegistry.h>

Public Member Functions

void Register (const ConditionSpec &spec)
 Registers a ConditionSpec.
 
const ConditionSpecGetConditionSpec (const std::string &id) const
 Returns the ConditionSpec for the given id, or nullptr if not found.
 
std::vector< std::string > GetAllConditionIds () const
 Returns all registered condition IDs.
 
std::vector< ConditionSpecGetAllConditions () const
 Returns all registered condition specs, sorted by id.
 

Static Public Member Functions

static ConditionRegistryGet ()
 Returns the singleton instance.
 

Private Member Functions

 ConditionRegistry ()
 
void InitializeBuiltInConditions ()
 

Private Attributes

std::unordered_map< std::string, ConditionSpecm_specs
 

Detailed Description

Singleton registry of available condition types.

Definition at line 51 of file ConditionRegistry.h.

Constructor & Destructor Documentation

◆ ConditionRegistry()

Olympe::ConditionRegistry::ConditionRegistry ( )
private

Definition at line 26 of file ConditionRegistry.cpp.

References InitializeBuiltInConditions().

+ Here is the call graph for this function:

Member Function Documentation

◆ Get()

ConditionRegistry & Olympe::ConditionRegistry::Get ( )
static

Returns the singleton instance.

Calls InitializeBuiltInConditions() on first access.

Definition at line 20 of file ConditionRegistry.cpp.

References GetComponentTypeID_Static().

Referenced by Olympe::VSGraphVerifier::CheckConditionIDs(), and Olympe::VSGraphVerifier::CheckConditionParams().

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

◆ GetAllConditionIds()

std::vector< std::string > Olympe::ConditionRegistry::GetAllConditionIds ( ) const

Returns all registered condition IDs.

Definition at line 51 of file ConditionRegistry.cpp.

References GetComponentTypeID_Static(), and m_specs.

+ Here is the call graph for this function:

◆ GetAllConditions()

std::vector< ConditionSpec > Olympe::ConditionRegistry::GetAllConditions ( ) const

Returns all registered condition specs, sorted by id.

Definition at line 61 of file ConditionRegistry.cpp.

References GetComponentTypeID_Static(), and m_specs.

+ Here is the call graph for this function:

◆ GetConditionSpec()

const ConditionSpec * Olympe::ConditionRegistry::GetConditionSpec ( const std::string &  id) const

Returns the ConditionSpec for the given id, or nullptr if not found.

Parameters
idCondition type ID.

Definition at line 45 of file ConditionRegistry.cpp.

References GetComponentTypeID_Static(), and m_specs.

+ Here is the call graph for this function:

◆ InitializeBuiltInConditions()

void Olympe::ConditionRegistry::InitializeBuiltInConditions ( )
private

Definition at line 78 of file ConditionRegistry.cpp.

References Olympe::ComparisonOp, GetComponentTypeID_Static(), Olympe::ConditionSpec::id, Olympe::Literal, Olympe::LocalVariable, and Register().

Referenced by ConditionRegistry().

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

◆ Register()

void Olympe::ConditionRegistry::Register ( const ConditionSpec spec)

Registers a ConditionSpec.

Parameters
specSpec to register (id must be non-empty).

Definition at line 35 of file ConditionRegistry.cpp.

References GetComponentTypeID_Static(), and m_specs.

Referenced by InitializeBuiltInConditions().

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

Member Data Documentation

◆ m_specs

std::unordered_map<std::string, ConditionSpec> Olympe::ConditionRegistry::m_specs
private

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