![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <EntityBlackboard.h>
Inheritance diagram for Olympe::EntityBlackboard:
Collaboration diagram for Olympe::EntityBlackboard:Public Member Functions | |
| EntityBlackboard (uint32_t entityID=0) | |
| ~EntityBlackboard () | |
| void | Initialize (const TaskGraphTemplate &tmpl, const std::unordered_map< std::string, TaskValue > *globalOverrides=nullptr) |
| void | Reset () |
| void | Clear () |
| TaskValue | GetValueScoped (const std::string &varName) const |
| void | SetValueScoped (const std::string &varName, const TaskValue &value) |
| TaskValue | GetGlobalValue (const std::string &globalKey) const |
| void | SetGlobalValue (const std::string &globalKey, const TaskValue &value) |
| TaskValue | GetLocalValue (const std::string &localKey) const |
| void | SetLocalValue (const std::string &localKey, const TaskValue &value) |
| bool | HasVariableScoped (const std::string &varName) const |
| bool | HasGlobalVariable (const std::string &globalKey) const |
| bool | HasLocalVariable (const std::string &localKey) const |
| size_t | GetTotalVariableCount () const |
| size_t | GetGlobalVariableCount () const |
| size_t | GetLocalVariableCount () const |
| uint32_t | GetEntityID () const |
| std::string | DebugSummary () const |
| void | DebugPrint () const |
| json | ExportGlobalsToJson () const |
| bool | ImportGlobalsFromJson (const json &data) |
Public Member Functions inherited from Olympe::LocalBlackboard | |
| LocalBlackboard () | |
| Default constructor. | |
| void | Initialize (const TaskGraphTemplate &tmpl) |
| Initialises the blackboard from a template. | |
| void | Reset () |
| Resets all variables to their default values. | |
| TaskValue | GetValue (const std::string &varName) const |
| Returns the current value of a variable. | |
| void | SetValue (const std::string &varName, const TaskValue &value) |
| Sets the value of a variable. | |
| bool | HasVariable (const std::string &varName) const |
| Returns true if a variable with the given name is registered. | |
| std::vector< std::string > | GetVariableNames () const |
| Returns all registered variable names (useful for debugging / editor). | |
| void | Serialize (std::vector< uint8_t > &outBytes) const |
| Serializes all variable names and typed values into a byte buffer. | |
| void | Deserialize (const std::vector< uint8_t > &inBytes) |
| Restores variable values from a byte buffer produced by Serialize(). | |
| void | InitializeFromEntries (const std::vector< BlackboardEntry > &entries) |
| Initializes the blackboard from a vector of BlackboardEntry (ATS VS schema v4). | |
| void | SetValueScoped (const std::string &scopedKey, const TaskValue &value) |
| Sets a value using a scoped key (prefix "local:" is stripped). | |
| TaskValue | GetValueScoped (const std::string &scopedKey) const |
| Gets a value using a scoped key (prefix "local:" is stripped). | |
Protected Attributes | |
| uint32_t | m_entityID |
| std::unordered_map< std::string, TaskValue > | m_globalVars |
| std::unordered_map< std::string, VariableType > | m_globalTypes |
Static Private Member Functions | |
| static void | ParseScopedName (const std::string &scopedName, std::string &outPrefix, std::string &outName) |
Definition at line 30 of file EntityBlackboard.h.
|
explicit |
Definition at line 18 of file EntityBlackboard.cpp.
| Olympe::EntityBlackboard::~EntityBlackboard | ( | ) |
Definition at line 23 of file EntityBlackboard.cpp.
| void Olympe::EntityBlackboard::Clear | ( | ) |
Definition at line 76 of file EntityBlackboard.cpp.
References m_globalTypes, and m_globalVars.
| void Olympe::EntityBlackboard::DebugPrint | ( | ) | const |
Definition at line 280 of file EntityBlackboard.cpp.
References DebugSummary(), GetGlobalVariableCount(), GetLocalVariableCount(), and SYSTEM_LOG.
Here is the call graph for this function:| std::string Olympe::EntityBlackboard::DebugSummary | ( | ) | const |
Definition at line 271 of file EntityBlackboard.cpp.
References GetComponentTypeID_Static(), GetGlobalVariableCount(), GetLocalVariableCount(), and m_entityID.
Referenced by DebugPrint().
Here is the call graph for this function:
Here is the caller graph for this function:| json Olympe::EntityBlackboard::ExportGlobalsToJson | ( | ) | const |
Definition at line 287 of file EntityBlackboard.cpp.
References Olympe::TaskValue::AsBool(), Olympe::TaskValue::AsEntityID(), Olympe::TaskValue::AsFloat(), Olympe::TaskValue::AsInt(), Olympe::TaskValue::AsString(), Olympe::TaskValue::AsVector(), Olympe::Bool, Olympe::EntityID, Olympe::Float, GetComponentTypeID_Static(), Olympe::TaskValue::GetType(), Olympe::Int, Olympe::TaskValue::IsNone(), m_globalVars, Olympe::String, Olympe::Vector, and Vector::x.
Here is the call graph for this function:| uint32_t Olympe::EntityBlackboard::GetEntityID | ( | ) | const |
Definition at line 266 of file EntityBlackboard.cpp.
References m_entityID.
Definition at line 133 of file EntityBlackboard.cpp.
References Olympe::GlobalEntryDefinition::DefaultValue, Olympe::GlobalTemplateBlackboard::Get(), GetComponentTypeID_Static(), m_globalTypes, m_globalVars, SYSTEM_LOG, and Olympe::VariableTypeToString().
Referenced by GetValueScoped().
Here is the call graph for this function:
Here is the caller graph for this function:| size_t Olympe::EntityBlackboard::GetGlobalVariableCount | ( | ) | const |
Definition at line 255 of file EntityBlackboard.cpp.
References m_globalVars.
Referenced by DebugPrint(), DebugSummary(), and GetTotalVariableCount().
Here is the caller graph for this function:Definition at line 211 of file EntityBlackboard.cpp.
References GetComponentTypeID_Static(), and Olympe::LocalBlackboard::GetValue().
Referenced by GetValueScoped().
Here is the call graph for this function:
Here is the caller graph for this function:| size_t Olympe::EntityBlackboard::GetLocalVariableCount | ( | ) | const |
Definition at line 260 of file EntityBlackboard.cpp.
Referenced by DebugPrint(), DebugSummary(), and GetTotalVariableCount().
Here is the caller graph for this function:| size_t Olympe::EntityBlackboard::GetTotalVariableCount | ( | ) | const |
Definition at line 250 of file EntityBlackboard.cpp.
References GetGlobalVariableCount(), and GetLocalVariableCount().
Here is the call graph for this function:Definition at line 82 of file EntityBlackboard.cpp.
References GetComponentTypeID_Static(), GetGlobalValue(), GetLocalValue(), HasLocalVariable(), and ParseScopedName().
Here is the call graph for this function:Definition at line 240 of file EntityBlackboard.cpp.
References GetComponentTypeID_Static(), and m_globalVars.
Referenced by HasVariableScoped().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 245 of file EntityBlackboard.cpp.
References GetComponentTypeID_Static(), and Olympe::LocalBlackboard::HasVariable().
Referenced by GetValueScoped(), HasVariableScoped(), and SetValueScoped().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 221 of file EntityBlackboard.cpp.
References GetComponentTypeID_Static(), HasGlobalVariable(), HasLocalVariable(), and ParseScopedName().
Here is the call graph for this function:Definition at line 338 of file EntityBlackboard.cpp.
References Olympe::Bool, Olympe::EntityID, Olympe::Float, GetComponentTypeID_Static(), Olympe::Int, m_globalTypes, m_globalVars, Olympe::String, SYSTEM_LOG, and Olympe::Vector.
Here is the call graph for this function:| void Olympe::EntityBlackboard::Initialize | ( | const TaskGraphTemplate & | tmpl, |
| const std::unordered_map< std::string, TaskValue > * | globalOverrides = nullptr |
||
| ) |
Definition at line 27 of file EntityBlackboard.cpp.
References Olympe::GlobalTemplateBlackboard::Get(), GetComponentTypeID_Static(), Olympe::LocalBlackboard::Initialize(), m_entityID, m_globalTypes, m_globalVars, and SYSTEM_LOG.
Here is the call graph for this function:
|
staticprivate |
Definition at line 416 of file EntityBlackboard.cpp.
References GetComponentTypeID_Static().
Referenced by GetValueScoped(), HasVariableScoped(), and SetValueScoped().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::EntityBlackboard::Reset | ( | ) |
Definition at line 60 of file EntityBlackboard.cpp.
References Olympe::GlobalTemplateBlackboard::Get(), GetComponentTypeID_Static(), m_entityID, m_globalTypes, m_globalVars, Olympe::LocalBlackboard::Reset(), and SYSTEM_LOG.
Here is the call graph for this function:| void Olympe::EntityBlackboard::SetGlobalValue | ( | const std::string & | globalKey, |
| const TaskValue & | value | ||
| ) |
Definition at line 169 of file EntityBlackboard.cpp.
References Olympe::GlobalTemplateBlackboard::Get(), GetComponentTypeID_Static(), Olympe::TaskValue::GetType(), m_globalTypes, m_globalVars, Olympe::None, SYSTEM_LOG, Olympe::GlobalEntryDefinition::Type, and Olympe::VariableTypeToString().
Referenced by SetValueScoped().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::EntityBlackboard::SetLocalValue | ( | const std::string & | localKey, |
| const TaskValue & | value | ||
| ) |
Definition at line 216 of file EntityBlackboard.cpp.
References GetComponentTypeID_Static(), and Olympe::LocalBlackboard::SetValue().
Referenced by SetValueScoped().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::EntityBlackboard::SetValueScoped | ( | const std::string & | varName, |
| const TaskValue & | value | ||
| ) |
Definition at line 106 of file EntityBlackboard.cpp.
References GetComponentTypeID_Static(), HasLocalVariable(), ParseScopedName(), SetGlobalValue(), and SetLocalValue().
Here is the call graph for this function:
|
protected |
Definition at line 69 of file EntityBlackboard.h.
Referenced by DebugSummary(), GetEntityID(), Initialize(), and Reset().
|
protected |
Definition at line 71 of file EntityBlackboard.h.
Referenced by Clear(), GetGlobalValue(), ImportGlobalsFromJson(), Initialize(), Reset(), and SetGlobalValue().
|
protected |
Definition at line 70 of file EntityBlackboard.h.
Referenced by Clear(), ExportGlobalsToJson(), GetGlobalValue(), GetGlobalVariableCount(), HasGlobalVariable(), ImportGlobalsFromJson(), Initialize(), Reset(), and SetGlobalValue().