![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Provides Blackboard variable values and dynamic pin values at runtime. More...
#include <RuntimeEnvironment.h>
Public Member Functions | |
| RuntimeEnvironment ()=default | |
| void | SetBlackboardVariable (const std::string &key, float value) |
| Stores or overwrites a Blackboard variable. | |
| bool | GetBlackboardVariable (const std::string &key, float &outValue) const |
| Looks up a Blackboard variable. | |
| bool | HasBlackboardVariable (const std::string &key) const |
| Returns true when the given key has been set. | |
| void | SetDynamicPinValue (const std::string &pinID, float value) |
| Stores or overwrites the runtime value for a dynamic data pin. | |
| bool | GetDynamicPinValue (const std::string &pinID, float &outValue) const |
| Looks up the runtime value of a dynamic data pin. | |
| void | Clear () |
| Removes all stored variables and pin values. | |
Private Attributes | |
| std::map< std::string, float > | m_blackboardVariables |
| Blackboard key -> value. | |
| std::map< std::string, float > | m_dynamicPinValues |
| Pin UUID -> value. | |
Provides Blackboard variable values and dynamic pin values at runtime.
Acts as the single source of truth for all float data during condition evaluation. Populated before evaluation begins (or updated dynamically as connected nodes provide new data).
Definition at line 36 of file RuntimeEnvironment.h.
|
default |
| void Olympe::RuntimeEnvironment::Clear | ( | ) |
Removes all stored variables and pin values.
Definition at line 57 of file RuntimeEnvironment.cpp.
References m_blackboardVariables, and m_dynamicPinValues.
| bool Olympe::RuntimeEnvironment::GetBlackboardVariable | ( | const std::string & | key, |
| float & | outValue | ||
| ) | const |
Looks up a Blackboard variable.
| key | Variable identifier. |
| outValue | Receives the value when found. |
Definition at line 21 of file RuntimeEnvironment.cpp.
References GetComponentTypeID_Static(), and m_blackboardVariables.
Here is the call graph for this function:| bool Olympe::RuntimeEnvironment::GetDynamicPinValue | ( | const std::string & | pinID, |
| float & | outValue | ||
| ) | const |
Looks up the runtime value of a dynamic data pin.
| pinID | Pin UUID. |
| outValue | Receives the value when found. |
Definition at line 44 of file RuntimeEnvironment.cpp.
References GetComponentTypeID_Static(), and m_dynamicPinValues.
Here is the call graph for this function:Returns true when the given key has been set.
| key | Variable identifier. |
Definition at line 30 of file RuntimeEnvironment.cpp.
References GetComponentTypeID_Static(), and m_blackboardVariables.
Here is the call graph for this function:Stores or overwrites a Blackboard variable.
| key | Variable identifier (e.g. "mHealth"). |
| value | Float value to associate with the key. |
Definition at line 16 of file RuntimeEnvironment.cpp.
References GetComponentTypeID_Static(), and m_blackboardVariables.
Referenced by Olympe::Examples::Example1_SimpleHealthCheck(), Olympe::Examples::Example3_ConditionChainAND(), Olympe::Examples::Example4_ConditionChainOR(), Olympe::Examples::Example5_ComparisonOperators(), and Olympe::GraphRuntimeInstance::SetBlackboardVariable().
Here is the call graph for this function:
Here is the caller graph for this function:Stores or overwrites the runtime value for a dynamic data pin.
| pinID | Pin UUID (matches DynamicDataPin::id or NodeConditionRef::leftPinID / rightPinID). |
| value | Float value delivered by the connected node. |
Definition at line 39 of file RuntimeEnvironment.cpp.
References GetComponentTypeID_Static(), and m_dynamicPinValues.
Referenced by Olympe::GraphRuntimeInstance::SetDynamicPinValue().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Blackboard key -> value.
Definition at line 96 of file RuntimeEnvironment.h.
Referenced by Clear(), GetBlackboardVariable(), HasBlackboardVariable(), and SetBlackboardVariable().
|
private |
Pin UUID -> value.
Definition at line 97 of file RuntimeEnvironment.h.
Referenced by Clear(), GetDynamicPinValue(), and SetDynamicPinValue().