Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Olympe::MathOpRef Struct Reference

Complete reference for a MathOp node: left operand, operator, right operand. More...

#include <MathOpOperand.h>

+ Collaboration diagram for Olympe::MathOpRef:

Public Member Functions

std::string GetDisplayString () const
 Returns a human-readable display string for the operation.
 
nlohmann::json ToJson () const
 Serializes this MathOpRef to a JSON object.
 

Static Public Member Functions

static MathOpRef FromJson (const nlohmann::json &data)
 Deserializes a MathOpRef from a JSON object.
 

Public Attributes

MathOpOperand leftOperand
 Left-hand side operand (A)
 
std::string mathOperator = "+"
 Arithmetic operator: "+", "-", "*", "/", "%", "^".
 
MathOpOperand rightOperand
 Right-hand side operand (B)
 

Detailed Description

Complete reference for a MathOp node: left operand, operator, right operand.

Stores the full operand configuration for one MathOp node. The result is computed as: leftOperand [operator] rightOperand. Operators supported: "+", "-", "*", "/", "%", "^" (power).

Operands whose mode is Pin automatically have DynamicDataPin objects generated for them by DynamicDataPinManager.

Definition at line 86 of file MathOpOperand.h.

Member Function Documentation

◆ FromJson()

MathOpRef Olympe::MathOpRef::FromJson ( const nlohmann::json data)
static

Deserializes a MathOpRef from a JSON object.

Definition at line 108 of file MathOpOperand.cpp.

References Olympe::MathOpOperand::FromJson(), GetComponentTypeID_Static(), and leftOperand.

Referenced by Olympe::TaskGraphLoader::ParseNodeV4().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDisplayString()

std::string Olympe::MathOpRef::GetDisplayString ( ) const

◆ ToJson()

nlohmann::json Olympe::MathOpRef::ToJson ( ) const

Serializes this MathOpRef to a JSON object.

Definition at line 97 of file MathOpOperand.cpp.

References GetComponentTypeID_Static(), leftOperand, mathOperator, rightOperand, and Olympe::MathOpOperand::ToJson().

Referenced by Olympe::VisualScriptEditorPanel::SerializeAndWrite().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ leftOperand

MathOpOperand Olympe::MathOpRef::leftOperand

◆ mathOperator

std::string Olympe::MathOpRef::mathOperator = "+"

◆ rightOperand

MathOpOperand Olympe::MathOpRef::rightOperand

The documentation for this struct was generated from the following files: