![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
TemplateManager - Manages blueprint templates Singleton manager for template catalog and operations. More...
#include <TemplateManager.h>
Public Member Functions | |
| void | Initialize (const std::string &templatesPath="Blueprints/Templates") |
| void | Shutdown () |
| bool | LoadTemplates (const std::string &templatesPath) |
| bool | SaveTemplate (const BlueprintTemplate &tpl) |
| bool | DeleteTemplate (const std::string &templateId) |
| bool | RefreshTemplates () |
| const std::vector< BlueprintTemplate > & | GetAllTemplates () const |
| const BlueprintTemplate * | FindTemplate (const std::string &id) const |
| std::vector< BlueprintTemplate > | GetTemplatesByCategory (const std::string &category) const |
| std::vector< std::string > | GetAllCategories () const |
| bool | ApplyTemplateToBlueprint (const std::string &templateId, json &targetBlueprint) |
| BlueprintTemplate | CreateTemplateFromBlueprint (const json &blueprint, const std::string &name, const std::string &description, const std::string &category, const std::string &author="User") |
| bool | IsInitialized () const |
| const std::string & | GetTemplatesPath () const |
| std::string | GetLastError () const |
| bool | HasError () const |
| void | ClearError () |
Static Public Member Functions | |
| static TemplateManager & | Instance () |
| static TemplateManager & | Get () |
Private Member Functions | |
| TemplateManager () | |
| ~TemplateManager () | |
| TemplateManager (const TemplateManager &)=delete | |
| TemplateManager & | operator= (const TemplateManager &)=delete |
| std::string | GenerateUUID () const |
| void | ScanTemplateDirectory () |
| bool | EnsureDirectoryExists (const std::string &path) |
Private Attributes | |
| bool | m_Initialized |
| std::string | m_TemplatesPath |
| std::vector< BlueprintTemplate > | m_Templates |
| std::string | m_LastError |
TemplateManager - Manages blueprint templates Singleton manager for template catalog and operations.
Definition at line 52 of file TemplateManager.h.
|
private |
Definition at line 124 of file TemplateManager.cpp.
|
private |
Definition at line 129 of file TemplateManager.cpp.
|
privatedelete |
| bool Olympe::TemplateManager::ApplyTemplateToBlueprint | ( | const std::string & | templateId, |
| json & | targetBlueprint | ||
| ) |
Definition at line 308 of file TemplateManager.cpp.
References FindTemplate(), GetComponentTypeID_Static(), and m_LastError.
Here is the call graph for this function:
|
inline |
Definition at line 91 of file TemplateManager.h.
References m_LastError.
| BlueprintTemplate Olympe::TemplateManager::CreateTemplateFromBlueprint | ( | const json & | blueprint, |
| const std::string & | name, | ||
| const std::string & | description, | ||
| const std::string & | category, | ||
| const std::string & | author = "User" |
||
| ) |
Definition at line 323 of file TemplateManager.cpp.
References GenerateUUID(), GetComponentTypeID_Static(), and Olympe::BlueprintTemplate::id.
Referenced by Olympe::BlueprintEditor::SaveCurrentAsTemplate().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 216 of file TemplateManager.cpp.
References GetComponentTypeID_Static(), m_LastError, m_Templates, and m_TemplatesPath.
Here is the call graph for this function:Definition at line 400 of file TemplateManager.cpp.
References GetComponentTypeID_Static().
Referenced by Initialize().
Here is the call graph for this function:
Here is the caller graph for this function:| const BlueprintTemplate * Olympe::TemplateManager::FindTemplate | ( | const std::string & | id | ) | const |
Definition at line 265 of file TemplateManager.cpp.
References GetComponentTypeID_Static(), and m_Templates.
Referenced by ApplyTemplateToBlueprint().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 346 of file TemplateManager.cpp.
References gen(), GetComponentTypeID_Static(), and rd.
Referenced by CreateTemplateFromBlueprint().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 56 of file TemplateManager.h.
References Instance().
Referenced by Olympe::BlueprintEditor::ApplyTemplate(), Olympe::BlueprintEditor::DeleteTemplate(), Olympe::BlueprintEditor::Initialize(), Olympe::BlueprintEditor::ReloadTemplates(), Olympe::TemplateBrowserPanel::RenderTemplateBrowser(), Olympe::BlueprintEditor::SaveCurrentAsTemplate(), and Olympe::BlueprintEditor::Shutdown().
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< std::string > Olympe::TemplateManager::GetAllCategories | ( | ) | const |
Definition at line 292 of file TemplateManager.cpp.
References GetComponentTypeID_Static(), and m_Templates.
Here is the call graph for this function:
|
inline |
Definition at line 69 of file TemplateManager.h.
References m_Templates.
|
inline |
Definition at line 89 of file TemplateManager.h.
References m_LastError.
Referenced by Olympe::BlueprintEditor::ApplyTemplate(), Olympe::BlueprintEditor::DeleteTemplate(), and Olympe::BlueprintEditor::SaveCurrentAsTemplate().
Here is the caller graph for this function:| std::vector< BlueprintTemplate > Olympe::TemplateManager::GetTemplatesByCategory | ( | const std::string & | category | ) | const |
Definition at line 277 of file TemplateManager.cpp.
References GetComponentTypeID_Static(), and m_Templates.
Here is the call graph for this function:
|
inline |
Definition at line 88 of file TemplateManager.h.
References m_TemplatesPath.
|
inline |
Definition at line 90 of file TemplateManager.h.
References m_LastError.
| void Olympe::TemplateManager::Initialize | ( | const std::string & | templatesPath = "Blueprints/Templates" | ) |
Definition at line 133 of file TemplateManager.cpp.
References EnsureDirectoryExists(), GetComponentTypeID_Static(), LoadTemplates(), m_Initialized, m_LastError, m_Templates, and m_TemplatesPath.
Referenced by Olympe::BlueprintEditor::Initialize().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 118 of file TemplateManager.cpp.
References GetComponentTypeID_Static().
Referenced by Get().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 87 of file TemplateManager.h.
References m_Initialized.
Definition at line 158 of file TemplateManager.cpp.
References GetComponentTypeID_Static(), m_LastError, m_Templates, m_TemplatesPath, and ScanTemplateDirectory().
Referenced by Initialize(), and RefreshTemplates().
Here is the call graph for this function:
Here is the caller graph for this function:
|
privatedelete |
| bool Olympe::TemplateManager::RefreshTemplates | ( | ) |
Definition at line 260 of file TemplateManager.cpp.
References LoadTemplates(), and m_TemplatesPath.
Referenced by Olympe::BlueprintEditor::ReloadTemplates().
Here is the call graph for this function:
Here is the caller graph for this function:| bool Olympe::TemplateManager::SaveTemplate | ( | const BlueprintTemplate & | tpl | ) |
Definition at line 175 of file TemplateManager.cpp.
References GetComponentTypeID_Static(), m_LastError, m_Templates, and m_TemplatesPath.
Here is the call graph for this function:
|
private |
Definition at line 369 of file TemplateManager.cpp.
References GetComponentTypeID_Static(), Olympe::BlueprintTemplate::LoadFromFile(), m_LastError, m_Templates, and m_TemplatesPath.
Referenced by LoadTemplates().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::TemplateManager::Shutdown | ( | ) |
Definition at line 152 of file TemplateManager.cpp.
References m_Initialized, and m_Templates.
Referenced by Olympe::BlueprintEditor::Shutdown().
Here is the caller graph for this function:
|
private |
Definition at line 108 of file TemplateManager.h.
Referenced by Initialize(), IsInitialized(), and Shutdown().
|
private |
Definition at line 111 of file TemplateManager.h.
Referenced by ApplyTemplateToBlueprint(), ClearError(), DeleteTemplate(), GetLastError(), HasError(), Initialize(), LoadTemplates(), SaveTemplate(), and ScanTemplateDirectory().
|
private |
Definition at line 110 of file TemplateManager.h.
Referenced by DeleteTemplate(), FindTemplate(), GetAllCategories(), GetAllTemplates(), GetTemplatesByCategory(), Initialize(), LoadTemplates(), SaveTemplate(), ScanTemplateDirectory(), and Shutdown().
|
private |
Definition at line 109 of file TemplateManager.h.
Referenced by DeleteTemplate(), GetTemplatesPath(), Initialize(), LoadTemplates(), RefreshTemplates(), SaveTemplate(), and ScanTemplateDirectory().