![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Non-singleton registry populated from the active TaskGraphTemplate. More...
#include <BBVariableRegistry.h>
Public Member Functions | |
| BBVariableRegistry ()=default | |
| void | LoadFromTemplate (const TaskGraphTemplate &tmpl) |
| Rebuilds the registry from the blackboard entries of a template. | |
| const std::vector< VarSpec > & | GetAllVariables () const |
| Returns all variables (local and global), sorted by name. | |
| std::vector< VarSpec > | GetVariablesByType (VariableType type) const |
Returns variables whose type matches type, sorted by name. | |
| std::vector< VarSpec > | GetLocalVariables () const |
| Returns only local-scope variables. | |
| std::vector< VarSpec > | GetGlobalVariables () const |
| Returns only global-scope variables. | |
| bool | HasVariable (const std::string &name) const |
| Returns true if a variable with the given name is registered. | |
| size_t | GetCount () const |
| Returns the number of registered variables. | |
Static Public Member Functions | |
| static std::string | FormatDisplayLabel (const std::string &name, VariableType type, bool isGlobal) |
| Formats a display label for a variable. | |
Private Attributes | |
| std::vector< VarSpec > | m_vars |
Non-singleton registry populated from the active TaskGraphTemplate.
Intentionally non-singleton because the variable set depends on which graph is currently open in the editor. Create one instance per editor panel and call LoadFromTemplate() whenever the template changes.
Definition at line 47 of file BBVariableRegistry.h.
|
default |
|
static |
Formats a display label for a variable.
Format: "<name> (<TypeName>, <scope>)" Example: "health (Float, local)"
| name | Variable key. |
| type | Variable type. |
| isGlobal | Scope flag. |
Definition at line 135 of file BBVariableRegistry.cpp.
References Olympe::VariableTypeName().
Referenced by LoadFromTemplate().
Here is the call graph for this function:
Here is the caller graph for this function:Returns all variables (local and global), sorted by name.
Definition at line 96 of file BBVariableRegistry.cpp.
References m_vars.
| size_t Olympe::BBVariableRegistry::GetCount | ( | ) | const |
Returns the number of registered variables.
Definition at line 153 of file BBVariableRegistry.cpp.
References m_vars.
| std::vector< VarSpec > Olympe::BBVariableRegistry::GetGlobalVariables | ( | ) | const |
Returns only global-scope variables.
Definition at line 123 of file BBVariableRegistry.cpp.
References GetComponentTypeID_Static(), and m_vars.
Here is the call graph for this function:| std::vector< VarSpec > Olympe::BBVariableRegistry::GetLocalVariables | ( | ) | const |
Returns only local-scope variables.
Definition at line 112 of file BBVariableRegistry.cpp.
References GetComponentTypeID_Static(), and m_vars.
Here is the call graph for this function:| std::vector< VarSpec > Olympe::BBVariableRegistry::GetVariablesByType | ( | VariableType | type | ) | const |
Returns variables whose type matches type, sorted by name.
| type | VariableType filter. |
Definition at line 101 of file BBVariableRegistry.cpp.
References GetComponentTypeID_Static(), and m_vars.
Here is the call graph for this function:Returns true if a variable with the given name is registered.
| name | Variable key to look up. |
Definition at line 143 of file BBVariableRegistry.cpp.
References GetComponentTypeID_Static(), and m_vars.
Here is the call graph for this function:| void Olympe::BBVariableRegistry::LoadFromTemplate | ( | const TaskGraphTemplate & | tmpl | ) |
Rebuilds the registry from the blackboard entries of a template.
| tmpl | Source template whose Blackboard vector is read. |
Definition at line 41 of file BBVariableRegistry.cpp.
References FormatDisplayLabel(), Olympe::GlobalTemplateBlackboard::Get(), GetComponentTypeID_Static(), m_vars, and Olympe::VarSpec::name.
Referenced by Olympe::VisualScriptEditorPanel::RenderNodeDataParameters(), Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanel(), Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanelContent(), Olympe::VisualScriptEditorPanel::RenderProperties(), Olympe::VisualScriptEditorPanel::RenderSwitchNodeProperties(), Olympe::GetBBValuePropertyPanel::RenderVariableSelector(), and Olympe::SetBBValuePropertyPanel::RenderVariableSelector().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 107 of file BBVariableRegistry.h.
Referenced by GetAllVariables(), GetCount(), GetGlobalVariables(), GetLocalVariables(), GetVariablesByType(), HasVariable(), and LoadFromTemplate().