36 if (data.contains(
"mode")) {
41 if (data.contains(
"variableName")) {
42 operand.variableName = data[
"variableName"].get<std::string>();
45 if (data.contains(
"constValue")) {
46 operand.constValue = data[
"constValue"].get<std::string>();
49 if (data.contains(
"dynamicPinID")) {
50 operand.dynamicPinID = data[
"dynamicPinID"].get<std::string>();
62 std::string result =
"[";
112 if (data.contains(
"leftOperand")) {
116 if (data.contains(
"mathOperator")) {
117 ref.mathOperator = data[
"mathOperator"].get<std::string>();
120 if (data.contains(
"rightOperand")) {
ComponentTypeID GetComponentTypeID_Static()
Defines MathOpOperand — operand references for MathOp nodes.
< Provides AssetID and INVALID_ASSET_ID
Represents one arithmetic operand (left A, right B) in a MathOp node.
Mode
Discriminates the data source of this operand.
@ Variable
References a blackboard variable by name.
@ Const
Literal constant value.
@ Pin
External data-input pin on the owning node.
std::string variableName
Blackboard key (mode == Variable), e.g. "mMoveSpeed".
std::string dynamicPinID
UUID of the DynamicDataPin that supplies this operand's value.
std::string constValue
Literal string (mode == Const), e.g. "5.0".
nlohmann::json ToJson() const
Serializes this MathOpOperand to a JSON object.
static MathOpOperand FromJson(const nlohmann::json &data)
Deserializes a MathOpOperand from a JSON object.
Complete reference for a MathOp node: left operand, operator, right operand.
static MathOpRef FromJson(const nlohmann::json &data)
Deserializes a MathOpRef from a JSON object.
MathOpOperand leftOperand
Left-hand side operand (A)
std::string mathOperator
Arithmetic operator: "+", "-", "*", "/", "%", "^".
nlohmann::json ToJson() const
Serializes this MathOpRef to a JSON object.
std::string GetDisplayString() const
Returns a human-readable display string for the operation.
MathOpOperand rightOperand
Right-hand side operand (B)