![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Represents one arithmetic operand (left A, right B) in a MathOp node. More...
#include <MathOpOperand.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 MathOpOperand to a JSON object. | |
Static Public Member Functions | |
| static MathOpOperand | FromJson (const nlohmann::json &data) |
| Deserializes a MathOpOperand from a JSON object. | |
Public Attributes | |
| Mode | mode = Mode::Const |
| Active mode. | |
| std::string | variableName |
| Blackboard key (mode == Variable), e.g. "mMoveSpeed". | |
| std::string | constValue |
| Literal string (mode == Const), e.g. "5.0". | |
| std::string | dynamicPinID |
| UUID of the DynamicDataPin that supplies this operand's value. | |
Represents one arithmetic operand (left A, right B) in a MathOp node.
Similar to OperandRef from ConditionRef.h, but adapted for arithmetic operations. If mode is Pin, dynamicPinID stores the UUID of the DynamicDataPin. If mode is Variable or Const, no pin is generated and dynamicPinID is empty.
Definition at line 36 of file MathOpOperand.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 39 of file MathOpOperand.h.
|
static |
Deserializes a MathOpOperand from a JSON object.
Definition at line 32 of file MathOpOperand.cpp.
References GetComponentTypeID_Static(), and mode.
Referenced by Olympe::MathOpRef::FromJson().
Here is the call graph for this function:
Here is the caller graph for this function:| nlohmann::json Olympe::MathOpOperand::ToJson | ( | ) | const |
Serializes this MathOpOperand to a JSON object.
Definition at line 14 of file MathOpOperand.cpp.
References constValue, dynamicPinID, GetComponentTypeID_Static(), mode, and variableName.
Referenced by Olympe::MathOpRef::ToJson().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string Olympe::MathOpOperand::constValue |
Literal string (mode == Const), e.g. "5.0".
Definition at line 50 of file MathOpOperand.h.
Referenced by Olympe::VisualScriptEditorPanel::AddNode(), Olympe::DataPinEvaluator_EvaluateRecursive(), Olympe::MathOpRef::GetDisplayString(), Olympe::VisualScriptNodeRenderer::RenderNode(), Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanel(), Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanelContent(), and ToJson().
| std::string Olympe::MathOpOperand::dynamicPinID |
UUID of the DynamicDataPin that supplies this operand's value.
Populated by DynamicDataPinManager when the parent MathOpOperand 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 61 of file MathOpOperand.h.
Referenced by Olympe::MathOpRef::GetDisplayString(), and ToJson().
| Mode Olympe::MathOpOperand::mode = Mode::Const |
Active mode.
Definition at line 46 of file MathOpOperand.h.
Referenced by Olympe::VisualScriptEditorPanel::AddNode(), Olympe::DataPinEvaluator_EvaluateRecursive(), FromJson(), Olympe::MathOpRef::GetDisplayString(), Olympe::VisualScriptNodeRenderer::RenderNode(), Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanel(), Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanelContent(), and ToJson().
| std::string Olympe::MathOpOperand::variableName |
Blackboard key (mode == Variable), e.g. "mMoveSpeed".
Definition at line 49 of file MathOpOperand.h.
Referenced by Olympe::DataPinEvaluator_EvaluateRecursive(), Olympe::MathOpRef::GetDisplayString(), Olympe::VisualScriptNodeRenderer::RenderNode(), Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanel(), Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanelContent(), and ToJson().