![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <GlobalTemplateBlackboard.h>
Public Member Functions | |
| bool | LoadFromFile (const std::string &configPath="./Config/global_blackboard_register.json") |
| bool | SaveToFile (const std::string &configPath="") const |
| void | Clear () |
| bool | AddVariable (const std::string &key, VariableType type, const TaskValue &defaultValue, const std::string &description="", bool isPersistent=false) |
| bool | UpdateVariable (const std::string &key, const TaskValue &defaultValue, const std::string &description="") |
| bool | RemoveVariable (const std::string &key) |
| bool | HasVariable (const std::string &key) const |
| const GlobalEntryDefinition * | GetVariable (const std::string &key) const |
| VariableType | GetVariableType (const std::string &key) const |
| TaskValue | GetDefaultValue (const std::string &key) const |
| const std::vector< GlobalEntryDefinition > & | GetAllVariables () const |
| size_t | GetVariableCount () const |
| bool | HasConflicts () const |
| std::string | DebugSummary () const |
| void | DebugPrint () const |
Static Public Member Functions | |
| static GlobalTemplateBlackboard & | Get () |
| static void | Reload () |
| Force reload of the registry from file (useful for hot reload) | |
| static bool | IsTypeCompatible (VariableType existingType, VariableType newType) |
Static Private Member Functions | |
| static bool | IsValidVariableName (const std::string &name) |
Private Attributes | |
| std::string | m_lastLoadedPath |
| Track the last successfully loaded path for consistent saves. | |
| std::unordered_map< std::string, size_t > | m_nameToIndex |
| std::vector< GlobalEntryDefinition > | m_variables |
Definition at line 82 of file GlobalTemplateBlackboard.h.
|
privatedefault |
|
privatedefault |
|
privatedelete |
|
privatedelete |
| bool Olympe::GlobalTemplateBlackboard::AddVariable | ( | const std::string & | key, |
| VariableType | type, | ||
| const TaskValue & | defaultValue, | ||
| const std::string & | description = "", |
||
| bool | isPersistent = false |
||
| ) |
Definition at line 426 of file GlobalTemplateBlackboard.cpp.
References Olympe::GlobalEntryDefinition::DefaultValue, Olympe::GlobalEntryDefinition::Description, GetComponentTypeID_Static(), Olympe::GetDefaultValueForType(), Olympe::TaskValue::GetType(), Olympe::TaskValue::IsNone(), Olympe::GlobalEntryDefinition::IsPersistent, IsValidVariableName(), Olympe::GlobalEntryDefinition::Key, m_nameToIndex, m_variables, Olympe::None, and Olympe::GlobalEntryDefinition::Type.
Referenced by LoadFromFile().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::GlobalTemplateBlackboard::Clear | ( | ) |
Definition at line 419 of file GlobalTemplateBlackboard.cpp.
References m_lastLoadedPath, m_nameToIndex, and m_variables.
Referenced by LoadFromFile(), and Reload().
Here is the caller graph for this function:| void Olympe::GlobalTemplateBlackboard::DebugPrint | ( | ) | const |
Definition at line 562 of file GlobalTemplateBlackboard.cpp.
References DebugSummary(), and SYSTEM_LOG.
Here is the call graph for this function:| std::string Olympe::GlobalTemplateBlackboard::DebugSummary | ( | ) | const |
Definition at line 552 of file GlobalTemplateBlackboard.cpp.
References GetComponentTypeID_Static(), m_variables, and Olympe::VariableTypeToString().
Referenced by DebugPrint().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 21 of file GlobalTemplateBlackboard.cpp.
References GetComponentTypeID_Static(), and SYSTEM_LOG.
Referenced by Olympe::EntityBlackboard::GetGlobalValue(), Olympe::EntityBlackboard::Initialize(), Olympe::BBVariableRegistry::LoadFromTemplate(), Reload(), Olympe::NodeConditionsPanel::RenderOperandDropdown(), Olympe::ConditionPresetEditDialog::RenderOperandSelector(), Olympe::EntityBlackboard::Reset(), and Olympe::EntityBlackboard::SetGlobalValue().
Here is the call graph for this function:
Here is the caller graph for this function:| const std::vector< GlobalEntryDefinition > & Olympe::GlobalTemplateBlackboard::GetAllVariables | ( | ) | const |
Definition at line 525 of file GlobalTemplateBlackboard.cpp.
References m_variables.
Definition at line 519 of file GlobalTemplateBlackboard.cpp.
References Olympe::GlobalEntryDefinition::DefaultValue, GetComponentTypeID_Static(), and GetVariable().
Here is the call graph for this function:| const GlobalEntryDefinition * Olympe::GlobalTemplateBlackboard::GetVariable | ( | const std::string & | key | ) | const |
Definition at line 505 of file GlobalTemplateBlackboard.cpp.
References GetComponentTypeID_Static(), m_nameToIndex, and m_variables.
Referenced by GetDefaultValue(), and GetVariableType().
Here is the call graph for this function:
Here is the caller graph for this function:| size_t Olympe::GlobalTemplateBlackboard::GetVariableCount | ( | ) | const |
Definition at line 530 of file GlobalTemplateBlackboard.cpp.
References m_variables.
| VariableType Olympe::GlobalTemplateBlackboard::GetVariableType | ( | const std::string & | key | ) | const |
Definition at line 513 of file GlobalTemplateBlackboard.cpp.
References GetComponentTypeID_Static(), GetVariable(), Olympe::None, and Olympe::GlobalEntryDefinition::Type.
Here is the call graph for this function:| bool Olympe::GlobalTemplateBlackboard::HasConflicts | ( | ) | const |
Definition at line 542 of file GlobalTemplateBlackboard.cpp.
References GetComponentTypeID_Static(), m_variables, and Olympe::None.
Here is the call graph for this function:Definition at line 500 of file GlobalTemplateBlackboard.cpp.
References GetComponentTypeID_Static(), and m_nameToIndex.
Here is the call graph for this function:
|
static |
Definition at line 535 of file GlobalTemplateBlackboard.cpp.
References GetComponentTypeID_Static(), and Olympe::None.
Here is the call graph for this function:
|
staticprivate |
Definition at line 567 of file GlobalTemplateBlackboard.cpp.
References GetComponentTypeID_Static().
Referenced by AddVariable().
Here is the call graph for this function:
Here is the caller graph for this function:| bool Olympe::GlobalTemplateBlackboard::LoadFromFile | ( | const std::string & | configPath = "./Config/global_blackboard_register.json" | ) |
Definition at line 91 of file GlobalTemplateBlackboard.cpp.
References AddVariable(), Olympe::Bool, Clear(), Olympe::EntityID, Olympe::Float, GetComponentTypeID_Static(), Olympe::GetDefaultValueForType(), Olympe::Int, m_lastLoadedPath, Olympe::None, Olympe::String, Olympe::StringToVariableType(), SYSTEM_LOG, and Olympe::Vector.
Referenced by Reload().
Here is the call graph for this function:
Here is the caller graph for this function:
|
privatedelete |
|
privatedelete |
|
static |
Force reload of the registry from file (useful for hot reload)
Definition at line 61 of file GlobalTemplateBlackboard.cpp.
References Clear(), Get(), GetComponentTypeID_Static(), LoadFromFile(), and SYSTEM_LOG.
Referenced by Olympe::VisualScriptEditorPanel::LoadTemplate().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 483 of file GlobalTemplateBlackboard.cpp.
References GetComponentTypeID_Static(), Key, m_nameToIndex, and m_variables.
Here is the call graph for this function:Definition at line 244 of file GlobalTemplateBlackboard.cpp.
References Olympe::Bool, Olympe::EntityID, Olympe::Float, GetComponentTypeID_Static(), Olympe::Int, m_lastLoadedPath, m_variables, Olympe::String, SYSTEM_LOG, Olympe::VariableTypeToString(), and Olympe::Vector.
Here is the call graph for this function:| bool Olympe::GlobalTemplateBlackboard::UpdateVariable | ( | const std::string & | key, |
| const TaskValue & | defaultValue, | ||
| const std::string & | description = "" |
||
| ) |
Definition at line 463 of file GlobalTemplateBlackboard.cpp.
References Olympe::GlobalEntryDefinition::DefaultValue, Olympe::GlobalEntryDefinition::Description, GetComponentTypeID_Static(), Olympe::TaskValue::GetType(), Olympe::TaskValue::IsNone(), m_nameToIndex, m_variables, and Olympe::GlobalEntryDefinition::Type.
Here is the call graph for this function:
|
mutableprivate |
Track the last successfully loaded path for consistent saves.
Definition at line 130 of file GlobalTemplateBlackboard.h.
Referenced by Clear(), LoadFromFile(), and SaveToFile().
|
private |
Definition at line 132 of file GlobalTemplateBlackboard.h.
Referenced by AddVariable(), Clear(), GetVariable(), HasVariable(), RemoveVariable(), and UpdateVariable().
|
private |
Definition at line 133 of file GlobalTemplateBlackboard.h.
Referenced by AddVariable(), Clear(), DebugSummary(), GetAllVariables(), GetVariable(), GetVariableCount(), HasConflicts(), RemoveVariable(), SaveToFile(), and UpdateVariable().