![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
References one operand of a condition (left or right). More...
#include <ConditionRef.h>
Public Types | |
| enum class | Mode { Variable , Const , Pin } |
| Discriminates the data source of this operand. More... | |
Public Member Functions | |
| nlohmann::json | ToJson () const |
| Serializes this OperandRef to a JSON object. | |
Static Public Member Functions | |
| static OperandRef | FromJson (const nlohmann::json &data) |
| Deserializes an OperandRef from a JSON object. | |
Public Attributes | |
| Mode | mode = Mode::Const |
| Active mode. | |
| std::string | variableName |
| Blackboard key (mode == Variable), e.g. "mHealth". | |
| std::string | constValue |
| Literal string (mode == Const), e.g. "100.0". | |
| std::string | dynamicPinID |
| UUID of the DynamicDataPin that supplies this operand's value. | |
References one operand of a condition (left or right).
If mode is Pin, dynamicPinID stores the UUID of the DynamicDataPin generated on the node by DynamicDataPinManager::RegeneratePinsFromConditions(). If mode is Variable or Const, no pin is generated and dynamicPinID is left empty.
Definition at line 43 of file ConditionRef.h.
|
strong |
Discriminates the data source of this operand.
| Enumerator | |
|---|---|
| Variable | References a blackboard variable by name. |
| Const | Literal constant value. |
| Pin | External data-input pin on the owning node. |
Definition at line 46 of file ConditionRef.h.
|
static |
Deserializes an OperandRef from a JSON object.
Definition at line 40 of file ConditionRef.cpp.
References Const, GetComponentTypeID_Static(), mode, Pin, and Variable.
Referenced by Olympe::ConditionRef::FromJson().
Here is the call graph for this function:
Here is the caller graph for this function:| nlohmann::json Olympe::OperandRef::ToJson | ( | ) | const |
Serializes this OperandRef to a JSON object.
Definition at line 20 of file ConditionRef.cpp.
References Const, constValue, dynamicPinID, GetComponentTypeID_Static(), mode, Pin, Variable, and variableName.
Referenced by Olympe::ConditionRef::ToJson().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string Olympe::OperandRef::constValue |
Literal string (mode == Const), e.g. "100.0".
Definition at line 57 of file ConditionRef.h.
Referenced by Olympe::NodeConditionsPanel::RenderOperandDropdown(), and ToJson().
| std::string Olympe::OperandRef::dynamicPinID |
UUID of the DynamicDataPin that supplies this operand's value.
Populated by DynamicDataPinManager::RegeneratePinsFromConditions() when the parent ConditionRef is registered with a Pin-mode operand. Format: "pin_inst_<random>", e.g. "pin_inst_abc123def456". Empty string means no pin has been assigned yet.
Definition at line 68 of file ConditionRef.h.
Referenced by Olympe::NodeConditionsPanel::RenderOperandDropdown(), and ToJson().
| Mode Olympe::OperandRef::mode = Mode::Const |
Active mode.
Definition at line 53 of file ConditionRef.h.
Referenced by FromJson(), Olympe::NodeConditionsPanel::RenderOperandDropdown(), and ToJson().
| std::string Olympe::OperandRef::variableName |
Blackboard key (mode == Variable), e.g. "mHealth".
Definition at line 56 of file ConditionRef.h.
Referenced by Olympe::NodeConditionsPanel::RenderConditionsPreview(), Olympe::NodeConditionsPanel::RenderOperandDropdown(), and ToJson().