30 default:
modeStr =
"Const";
break;
43 if (!data.is_object())
46 if (data.contains(
"mode") && data[
"mode"].is_string())
48 const std::string&
modeStr = data[
"mode"].get<std::string>();
57 if (data.contains(
"variableName") && data[
"variableName"].is_string())
58 ref.variableName = data[
"variableName"].get<std::string>();
60 if (data.contains(
"constValue") && data[
"constValue"].is_string())
61 ref.constValue = data[
"constValue"].get<std::string>();
63 if (data.contains(
"dynamicPinID") && data[
"dynamicPinID"].is_string())
64 ref.dynamicPinID = data[
"dynamicPinID"].get<std::string>();
89 default:
typeStr =
"Float";
break;
99 if (!data.is_object())
102 if (data.contains(
"conditionIndex") && data[
"conditionIndex"].is_number_integer())
105 if (data.contains(
"leftOperand") && data[
"leftOperand"].is_object())
108 if (data.contains(
"operator") && data[
"operator"].is_string())
109 ref.operatorStr = data[
"operator"].get<std::string>();
111 if (data.contains(
"rightOperand") && data[
"rightOperand"].is_object())
114 if (data.contains(
"compareType") && data[
"compareType"].is_string())
116 const std::string&
typeStr = data[
"compareType"].get<std::string>();
Defines OperandRef and ConditionRef — standalone operand-to-pin mapping structures.
ComponentTypeID GetComponentTypeID_Static()
< Provides AssetID and INVALID_ASSET_ID
@ Int
32-bit signed integer
@ Float
Single-precision float.
Stores the complete reference for one condition including operand-to-DynamicDataPin mapping.
OperandRef rightOperand
Right-hand side of the comparison.
OperandRef leftOperand
Left-hand side of the comparison.
std::string operatorStr
Comparison operator: "==", "<=", ">=", "!=", "<", ">".
VariableType compareType
Expected value type of both operands.
int conditionIndex
Index in the Branch/While node's conditions[] array.
static ConditionRef FromJson(const nlohmann::json &data)
Deserializes a ConditionRef from a JSON object.
nlohmann::json ToJson() const
Serializes this ConditionRef to a JSON object.
References one operand of a condition (left or right).
static OperandRef FromJson(const nlohmann::json &data)
Deserializes an OperandRef from a JSON object.
@ Variable
References a blackboard variable by name.
@ Const
Literal constant value.
@ Pin
External data-input pin on the owning node.
std::string constValue
Literal string (mode == Const), e.g. "100.0".
std::string variableName
Blackboard key (mode == Variable), e.g. "mHealth".
nlohmann::json ToJson() const
Serializes this OperandRef to a JSON object.
std::string dynamicPinID
UUID of the DynamicDataPin that supplies this operand's value.