Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Olympe::GlobalTemplateBlackboard Class Reference

#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 GlobalEntryDefinitionGetVariable (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 GlobalTemplateBlackboardGet ()
 
static void Reload ()
 Force reload of the registry from file (useful for hot reload)
 
static bool IsTypeCompatible (VariableType existingType, VariableType newType)
 

Private Member Functions

 GlobalTemplateBlackboard ()=default
 
 ~GlobalTemplateBlackboard ()=default
 
 GlobalTemplateBlackboard (const GlobalTemplateBlackboard &)=delete
 
GlobalTemplateBlackboardoperator= (const GlobalTemplateBlackboard &)=delete
 
 GlobalTemplateBlackboard (GlobalTemplateBlackboard &&)=delete
 
GlobalTemplateBlackboardoperator= (GlobalTemplateBlackboard &&)=delete
 

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_tm_nameToIndex
 
std::vector< GlobalEntryDefinitionm_variables
 

Detailed Description

Definition at line 82 of file GlobalTemplateBlackboard.h.

Constructor & Destructor Documentation

◆ GlobalTemplateBlackboard() [1/3]

Olympe::GlobalTemplateBlackboard::GlobalTemplateBlackboard ( )
privatedefault

◆ ~GlobalTemplateBlackboard()

Olympe::GlobalTemplateBlackboard::~GlobalTemplateBlackboard ( )
privatedefault

◆ GlobalTemplateBlackboard() [2/3]

Olympe::GlobalTemplateBlackboard::GlobalTemplateBlackboard ( const GlobalTemplateBlackboard )
privatedelete

◆ GlobalTemplateBlackboard() [3/3]

Olympe::GlobalTemplateBlackboard::GlobalTemplateBlackboard ( GlobalTemplateBlackboard &&  )
privatedelete

Member Function Documentation

◆ AddVariable()

bool Olympe::GlobalTemplateBlackboard::AddVariable ( const std::string &  key,
VariableType  type,
const TaskValue defaultValue,
const std::string &  description = "",
bool  isPersistent = false 
)

◆ Clear()

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:

◆ DebugPrint()

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:

◆ DebugSummary()

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:

◆ Get()

GlobalTemplateBlackboard & Olympe::GlobalTemplateBlackboard::Get ( )
static

◆ GetAllVariables()

const std::vector< GlobalEntryDefinition > & Olympe::GlobalTemplateBlackboard::GetAllVariables ( ) const

Definition at line 525 of file GlobalTemplateBlackboard.cpp.

References m_variables.

◆ GetDefaultValue()

TaskValue Olympe::GlobalTemplateBlackboard::GetDefaultValue ( const std::string &  key) const

Definition at line 519 of file GlobalTemplateBlackboard.cpp.

References Olympe::GlobalEntryDefinition::DefaultValue, GetComponentTypeID_Static(), and GetVariable().

+ Here is the call graph for this function:

◆ GetVariable()

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:

◆ GetVariableCount()

size_t Olympe::GlobalTemplateBlackboard::GetVariableCount ( ) const

Definition at line 530 of file GlobalTemplateBlackboard.cpp.

References m_variables.

◆ GetVariableType()

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:

◆ HasConflicts()

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:

◆ HasVariable()

bool Olympe::GlobalTemplateBlackboard::HasVariable ( const std::string &  key) const

Definition at line 500 of file GlobalTemplateBlackboard.cpp.

References GetComponentTypeID_Static(), and m_nameToIndex.

+ Here is the call graph for this function:

◆ IsTypeCompatible()

bool Olympe::GlobalTemplateBlackboard::IsTypeCompatible ( VariableType  existingType,
VariableType  newType 
)
static

Definition at line 535 of file GlobalTemplateBlackboard.cpp.

References GetComponentTypeID_Static(), and Olympe::None.

+ Here is the call graph for this function:

◆ IsValidVariableName()

bool Olympe::GlobalTemplateBlackboard::IsValidVariableName ( const std::string &  name)
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:

◆ LoadFromFile()

bool Olympe::GlobalTemplateBlackboard::LoadFromFile ( const std::string &  configPath = "./Config/global_blackboard_register.json")

◆ operator=() [1/2]

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

◆ operator=() [2/2]

GlobalTemplateBlackboard & Olympe::GlobalTemplateBlackboard::operator= ( GlobalTemplateBlackboard &&  )
privatedelete

◆ Reload()

void Olympe::GlobalTemplateBlackboard::Reload ( )
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:

◆ RemoveVariable()

bool Olympe::GlobalTemplateBlackboard::RemoveVariable ( const std::string &  key)

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:

◆ SaveToFile()

bool Olympe::GlobalTemplateBlackboard::SaveToFile ( const std::string &  configPath = "") const

◆ UpdateVariable()

bool Olympe::GlobalTemplateBlackboard::UpdateVariable ( const std::string &  key,
const TaskValue defaultValue,
const std::string &  description = "" 
)

Member Data Documentation

◆ m_lastLoadedPath

std::string Olympe::GlobalTemplateBlackboard::m_lastLoadedPath
mutableprivate

Track the last successfully loaded path for consistent saves.

Definition at line 130 of file GlobalTemplateBlackboard.h.

Referenced by Clear(), LoadFromFile(), and SaveToFile().

◆ m_nameToIndex

std::unordered_map<std::string, size_t> Olympe::GlobalTemplateBlackboard::m_nameToIndex
private

◆ m_variables

std::vector<GlobalEntryDefinition> Olympe::GlobalTemplateBlackboard::m_variables
private

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