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::NodeConditionRef Struct Reference

One entry in a NodeBranch's conditions list. More...

#include <NodeConditionRef.h>

Public Member Functions

 NodeConditionRef ()
 Default constructor — empty preset ID, LogicalOp::Start.
 
 NodeConditionRef (const std::string &pid, LogicalOp op)
 Convenience constructor.
 
std::string GetLogicalOpString () const
 Returns the logical-op as a display string ("Start", "And", "Or").
 
bool HasLeftPin () const
 Returns true when a left-side DynamicDataPin is assigned.
 
bool HasRightPin () const
 Returns true when a right-side DynamicDataPin is assigned.
 
nlohmann::json ToJson () const
 Serializes this ref to a JSON object.
 

Static Public Member Functions

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

Public Attributes

std::string presetID
 UUID of the referenced ConditionPreset.
 
LogicalOp logicalOp
 Combinator with previous condition (ignored for first)
 
std::string leftPinID
 DynamicDataPin UUID for left Pin operand (or empty)
 
std::string rightPinID
 DynamicDataPin UUID for right Pin operand (or empty)
 

Detailed Description

One entry in a NodeBranch's conditions list.

References a ConditionPreset by UUID. If the referenced preset's left or right operand is in Pin mode, leftPinID / rightPinID store the UUID of the corresponding DynamicDataPin so the runtime evaluator can find the live float value.

Definition at line 45 of file NodeConditionRef.h.

Constructor & Destructor Documentation

◆ NodeConditionRef() [1/2]

Olympe::NodeConditionRef::NodeConditionRef ( )

Default constructor — empty preset ID, LogicalOp::Start.

Definition at line 20 of file NodeConditionRef.cpp.

◆ NodeConditionRef() [2/2]

Olympe::NodeConditionRef::NodeConditionRef ( const std::string &  pid,
LogicalOp  op 
)

Convenience constructor.

Parameters
pidPreset UUID to reference.
opLogical combinator (Start for the first condition).

Definition at line 28 of file NodeConditionRef.cpp.

Member Function Documentation

◆ FromJson()

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

Deserializes a NodeConditionRef from a JSON object.

Definition at line 76 of file NodeConditionRef.cpp.

References Olympe::And, GetComponentTypeID_Static(), Olympe::Or, presetID, and Olympe::Start.

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

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

◆ GetLogicalOpString()

std::string Olympe::NodeConditionRef::GetLogicalOpString ( ) const

Returns the logical-op as a display string ("Start", "And", "Or").

Definition at line 40 of file NodeConditionRef.cpp.

References Olympe::And, logicalOp, Olympe::Or, and Olympe::Start.

Referenced by ToJson().

+ Here is the caller graph for this function:

◆ HasLeftPin()

bool Olympe::NodeConditionRef::HasLeftPin ( ) const

Returns true when a left-side DynamicDataPin is assigned.

Definition at line 51 of file NodeConditionRef.cpp.

References leftPinID.

◆ HasRightPin()

bool Olympe::NodeConditionRef::HasRightPin ( ) const

Returns true when a right-side DynamicDataPin is assigned.

Definition at line 56 of file NodeConditionRef.cpp.

References rightPinID.

◆ ToJson()

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

Serializes this ref to a JSON object.

Definition at line 65 of file NodeConditionRef.cpp.

References GetComponentTypeID_Static(), GetLogicalOpString(), leftPinID, presetID, and rightPinID.

+ Here is the call graph for this function:

Member Data Documentation

◆ leftPinID

std::string Olympe::NodeConditionRef::leftPinID

DynamicDataPin UUID for left Pin operand (or empty)

Definition at line 48 of file NodeConditionRef.h.

Referenced by HasLeftPin(), and ToJson().

◆ logicalOp

LogicalOp Olympe::NodeConditionRef::logicalOp

Combinator with previous condition (ignored for first)

Definition at line 47 of file NodeConditionRef.h.

Referenced by GetLogicalOpString().

◆ presetID

std::string Olympe::NodeConditionRef::presetID

UUID of the referenced ConditionPreset.

Definition at line 46 of file NodeConditionRef.h.

Referenced by FromJson(), ToJson(), and Olympe::NodeConditionsPanel::Validate().

◆ rightPinID

std::string Olympe::NodeConditionRef::rightPinID

DynamicDataPin UUID for right Pin operand (or empty)

Definition at line 49 of file NodeConditionRef.h.

Referenced by HasRightPin(), and ToJson().


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