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

EnumCatalogManager - Singleton manager for enum catalogs Loads and manages dynamic type definitions for the node editor. More...

#include <EnumCatalogManager.h>

Public Member Functions

void Initialize ()
 
void Shutdown ()
 
bool LoadCatalogs (const std::string &catalogsPath)
 
bool LoadCatalog (const std::string &filepath)
 
bool ReloadCatalogs ()
 
const EnumCatalogGetActionCatalog () const
 
const EnumCatalogGetConditionCatalog () const
 
const EnumCatalogGetDecoratorCatalog () const
 
std::vector< std::string > GetActionTypes () const
 
std::vector< std::string > GetConditionTypes () const
 
std::vector< std::string > GetDecoratorTypes () const
 
const CatalogTypeFindActionType (const std::string &id) const
 
const CatalogTypeFindConditionType (const std::string &id) const
 
const CatalogTypeFindDecoratorType (const std::string &id) const
 
bool IsValidActionType (const std::string &id) const
 
bool IsValidConditionType (const std::string &id) const
 
bool IsValidDecoratorType (const std::string &id) const
 
bool IsInitialized () const
 
std::string GetLastError () const
 
std::string GetCatalogsPath () const
 

Static Public Member Functions

static EnumCatalogManagerInstance ()
 
static EnumCatalogManagerGet ()
 

Private Member Functions

 EnumCatalogManager ()
 
 ~EnumCatalogManager ()
 
 EnumCatalogManager (const EnumCatalogManager &)=delete
 
EnumCatalogManageroperator= (const EnumCatalogManager &)=delete
 
bool ParseCatalogJson (const nlohmann::json &j, EnumCatalog &catalog)
 
bool ParseCatalogType (const nlohmann::json &j, CatalogType &type)
 
bool ParseCatalogParameter (const nlohmann::json &j, CatalogParameter &param)
 
bool ValidateCatalog (const EnumCatalog &catalog, std::string &errorMsg)
 

Private Attributes

bool m_Initialized
 
std::string m_CatalogsPath
 
std::string m_LastError
 
std::unique_ptr< EnumCatalogm_ActionCatalog
 
std::unique_ptr< EnumCatalogm_ConditionCatalog
 
std::unique_ptr< EnumCatalogm_DecoratorCatalog
 

Detailed Description

EnumCatalogManager - Singleton manager for enum catalogs Loads and manages dynamic type definitions for the node editor.

Definition at line 88 of file EnumCatalogManager.h.

Constructor & Destructor Documentation

◆ EnumCatalogManager() [1/2]

Olympe::EnumCatalogManager::EnumCatalogManager ( )
private

Definition at line 21 of file EnumCatalogManager.cpp.

◆ ~EnumCatalogManager()

Olympe::EnumCatalogManager::~EnumCatalogManager ( )
private

Definition at line 27 of file EnumCatalogManager.cpp.

References Shutdown().

+ Here is the call graph for this function:

◆ EnumCatalogManager() [2/2]

Olympe::EnumCatalogManager::EnumCatalogManager ( const EnumCatalogManager )
privatedelete

Member Function Documentation

◆ FindActionType()

const CatalogType * Olympe::EnumCatalogManager::FindActionType ( const std::string &  id) const

◆ FindConditionType()

const CatalogType * Olympe::EnumCatalogManager::FindConditionType ( const std::string &  id) const

◆ FindDecoratorType()

const CatalogType * Olympe::EnumCatalogManager::FindDecoratorType ( const std::string &  id) const

Definition at line 318 of file EnumCatalogManager.cpp.

References m_DecoratorCatalog.

Referenced by IsValidDecoratorType(), Olympe::AssetBrowser::RenderNodePalette(), and Olympe::BlueprintValidator::ValidateNodeParameters().

+ Here is the caller graph for this function:

◆ Get()

static EnumCatalogManager & Olympe::EnumCatalogManager::Get ( )
inlinestatic

◆ GetActionCatalog()

const EnumCatalog * Olympe::EnumCatalogManager::GetActionCatalog ( ) const
inline

Definition at line 105 of file EnumCatalogManager.h.

References m_ActionCatalog.

◆ GetActionTypes()

std::vector< std::string > Olympe::EnumCatalogManager::GetActionTypes ( ) const

◆ GetCatalogsPath()

std::string Olympe::EnumCatalogManager::GetCatalogsPath ( ) const
inline

Definition at line 127 of file EnumCatalogManager.h.

References m_CatalogsPath.

◆ GetConditionCatalog()

const EnumCatalog * Olympe::EnumCatalogManager::GetConditionCatalog ( ) const
inline

Definition at line 106 of file EnumCatalogManager.h.

References m_ConditionCatalog.

◆ GetConditionTypes()

std::vector< std::string > Olympe::EnumCatalogManager::GetConditionTypes ( ) const

◆ GetDecoratorCatalog()

const EnumCatalog * Olympe::EnumCatalogManager::GetDecoratorCatalog ( ) const
inline

Definition at line 107 of file EnumCatalogManager.h.

References m_DecoratorCatalog.

◆ GetDecoratorTypes()

std::vector< std::string > Olympe::EnumCatalogManager::GetDecoratorTypes ( ) const

◆ GetLastError()

std::string Olympe::EnumCatalogManager::GetLastError ( ) const
inline

Definition at line 126 of file EnumCatalogManager.h.

References m_LastError.

◆ Initialize()

void Olympe::EnumCatalogManager::Initialize ( )

Definition at line 32 of file EnumCatalogManager.cpp.

References LoadCatalogs(), m_CatalogsPath, m_Initialized, and m_LastError.

Referenced by Olympe::BlueprintEditor::Initialize().

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

◆ Instance()

EnumCatalogManager & Olympe::EnumCatalogManager::Instance ( )
static

Definition at line 15 of file EnumCatalogManager.cpp.

References GetComponentTypeID_Static().

Referenced by Get().

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

◆ IsInitialized()

bool Olympe::EnumCatalogManager::IsInitialized ( ) const
inline

Definition at line 125 of file EnumCatalogManager.h.

References m_Initialized.

◆ IsValidActionType()

bool Olympe::EnumCatalogManager::IsValidActionType ( const std::string &  id) const

Definition at line 326 of file EnumCatalogManager.cpp.

References FindActionType().

+ Here is the call graph for this function:

◆ IsValidConditionType()

bool Olympe::EnumCatalogManager::IsValidConditionType ( const std::string &  id) const

Definition at line 331 of file EnumCatalogManager.cpp.

References FindConditionType().

+ Here is the call graph for this function:

◆ IsValidDecoratorType()

bool Olympe::EnumCatalogManager::IsValidDecoratorType ( const std::string &  id) const

Definition at line 336 of file EnumCatalogManager.cpp.

References FindDecoratorType().

+ Here is the call graph for this function:

◆ LoadCatalog()

bool Olympe::EnumCatalogManager::LoadCatalog ( const std::string &  filepath)

Definition at line 93 of file EnumCatalogManager.cpp.

References GetComponentTypeID_Static(), m_ActionCatalog, m_ConditionCatalog, m_DecoratorCatalog, m_LastError, ParseCatalogJson(), and ValidateCatalog().

Referenced by LoadCatalogs().

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

◆ LoadCatalogs()

bool Olympe::EnumCatalogManager::LoadCatalogs ( const std::string &  catalogsPath)

Definition at line 64 of file EnumCatalogManager.cpp.

References GetComponentTypeID_Static(), LoadCatalog(), m_CatalogsPath, and m_LastError.

Referenced by Initialize(), and ReloadCatalogs().

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

◆ operator=()

EnumCatalogManager & Olympe::EnumCatalogManager::operator= ( const EnumCatalogManager )
privatedelete

◆ ParseCatalogJson()

bool Olympe::EnumCatalogManager::ParseCatalogJson ( const nlohmann::json j,
EnumCatalog catalog 
)
private

Definition at line 172 of file EnumCatalogManager.cpp.

References JsonHelper::ForEachInArray(), GetComponentTypeID_Static(), JsonHelper::GetString(), JsonHelper::IsArray(), m_LastError, and ParseCatalogType().

Referenced by LoadCatalog().

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

◆ ParseCatalogParameter()

bool Olympe::EnumCatalogManager::ParseCatalogParameter ( const nlohmann::json j,
CatalogParameter param 
)
private

Definition at line 228 of file EnumCatalogManager.cpp.

References JsonHelper::GetBool(), GetComponentTypeID_Static(), and JsonHelper::GetString().

Referenced by ParseCatalogType().

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

◆ ParseCatalogType()

bool Olympe::EnumCatalogManager::ParseCatalogType ( const nlohmann::json j,
CatalogType type 
)
private

◆ ReloadCatalogs()

bool Olympe::EnumCatalogManager::ReloadCatalogs ( )

Definition at line 159 of file EnumCatalogManager.cpp.

References LoadCatalogs(), m_ActionCatalog, m_CatalogsPath, m_ConditionCatalog, and m_DecoratorCatalog.

+ Here is the call graph for this function:

◆ Shutdown()

void Olympe::EnumCatalogManager::Shutdown ( )

Definition at line 50 of file EnumCatalogManager.cpp.

References m_ActionCatalog, m_ConditionCatalog, m_DecoratorCatalog, and m_Initialized.

Referenced by Olympe::BlueprintEditor::Shutdown(), and ~EnumCatalogManager().

+ Here is the caller graph for this function:

◆ ValidateCatalog()

bool Olympe::EnumCatalogManager::ValidateCatalog ( const EnumCatalog catalog,
std::string &  errorMsg 
)
private

Definition at line 249 of file EnumCatalogManager.cpp.

References GetComponentTypeID_Static().

Referenced by LoadCatalog().

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

Member Data Documentation

◆ m_ActionCatalog

std::unique_ptr<EnumCatalog> Olympe::EnumCatalogManager::m_ActionCatalog
private

◆ m_CatalogsPath

std::string Olympe::EnumCatalogManager::m_CatalogsPath
private

Definition at line 148 of file EnumCatalogManager.h.

Referenced by GetCatalogsPath(), Initialize(), LoadCatalogs(), and ReloadCatalogs().

◆ m_ConditionCatalog

std::unique_ptr<EnumCatalog> Olympe::EnumCatalogManager::m_ConditionCatalog
private

◆ m_DecoratorCatalog

std::unique_ptr<EnumCatalog> Olympe::EnumCatalogManager::m_DecoratorCatalog
private

◆ m_Initialized

bool Olympe::EnumCatalogManager::m_Initialized
private

Definition at line 147 of file EnumCatalogManager.h.

Referenced by Initialize(), IsInitialized(), and Shutdown().

◆ m_LastError

std::string Olympe::EnumCatalogManager::m_LastError
private

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