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

A data-input pin created dynamically for a Pin-mode operand. More...

#include <DynamicDataPin.h>

Public Member Functions

 DynamicDataPin ()
 Default constructor — zero-initialised.
 
 DynamicDataPin (int condIdx, OperandPosition pos, const std::string &condPreview)
 Convenience constructor.
 
std::string GetDisplayLabel () const
 Returns the full display label shown on the node.
 
std::string GetShortLabel () const
 Returns the short label for use as a pin connector slot.
 
nlohmann::json ToJson () const
 Serializes this pin to a JSON object.
 

Static Public Member Functions

static std::string GenerateUniqueID ()
 Generates a globally unique identifier string (UUID v4-style).
 
static DynamicDataPin FromJson (const nlohmann::json &data)
 Deserializes a DynamicDataPin from a JSON object.
 

Public Attributes

std::string id
 Global unique UUID (e.g. "pin_inst_abc123")
 
int conditionIndex
 Index in node.conditions (0-based)
 
OperandPosition position
 Left or Right operand side.
 
std::string label
 Display label (set at construction)
 
std::string nodePinID
 ImGui/ImNodes pin ID (assigned at render time)
 
float dataValue
 Runtime float value received from connected node.
 
int sequenceNumber
 1-based sequence index across all pins on the node (for "Pin-in #N" label)
 

Detailed Description

A data-input pin created dynamically for a Pin-mode operand.

Created automatically by the Dynamic Pin Manager (Phase 24.3) when a ConditionPreset containing a Pin-mode operand is assigned to a NodeBranch. The nodePinID field is populated at render time (ImNodes pin ID).

Definition at line 47 of file DynamicDataPin.h.

Constructor & Destructor Documentation

◆ DynamicDataPin() [1/2]

Olympe::DynamicDataPin::DynamicDataPin ( )

Default constructor — zero-initialised.

Definition at line 31 of file DynamicDataPin.cpp.

◆ DynamicDataPin() [2/2]

Olympe::DynamicDataPin::DynamicDataPin ( int  condIdx,
OperandPosition  pos,
const std::string &  condPreview 
)

Convenience constructor.

Parameters
condIdxIndex of the owning condition in node.conditions.
posWhich operand side (Left or Right).
condPreviewShort preview of the parent condition for the label (e.g. "[mSpeed] == [Pin:1]").

Definition at line 46 of file DynamicDataPin.cpp.

References GetComponentTypeID_Static(), label, and Olympe::Left.

+ Here is the call graph for this function:

Member Function Documentation

◆ FromJson()

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

Deserializes a DynamicDataPin from a JSON object.

Definition at line 130 of file DynamicDataPin.cpp.

References GetComponentTypeID_Static(), id, Olympe::Left, and Olympe::Right.

+ Here is the call graph for this function:

◆ GenerateUniqueID()

std::string Olympe::DynamicDataPin::GenerateUniqueID ( )
static

Generates a globally unique identifier string (UUID v4-style).

Definition at line 79 of file DynamicDataPin.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetDisplayLabel()

std::string Olympe::DynamicDataPin::GetDisplayLabel ( ) const

Returns the full display label shown on the node.

Format: "In #<condIdx+1><L|R>: <condPreview>" Example: "In #3L: [mSpeed] == [Pin:1]"

Definition at line 66 of file DynamicDataPin.cpp.

References label.

◆ GetShortLabel()

std::string Olympe::DynamicDataPin::GetShortLabel ( ) const

Returns the short label for use as a pin connector slot.

Format: "Pin-in #<sequenceNumber>" Example: "Pin-in #1"

Definition at line 71 of file DynamicDataPin.cpp.

References GetComponentTypeID_Static(), and sequenceNumber.

+ Here is the call graph for this function:

◆ ToJson()

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

Serializes this pin to a JSON object.

Definition at line 117 of file DynamicDataPin.cpp.

References conditionIndex, dataValue, GetComponentTypeID_Static(), id, label, Olympe::Left, nodePinID, and position.

+ Here is the call graph for this function:

Member Data Documentation

◆ conditionIndex

int Olympe::DynamicDataPin::conditionIndex

Index in node.conditions (0-based)

Definition at line 49 of file DynamicDataPin.h.

Referenced by ToJson().

◆ dataValue

float Olympe::DynamicDataPin::dataValue

Runtime float value received from connected node.

Definition at line 53 of file DynamicDataPin.h.

Referenced by ToJson().

◆ id

std::string Olympe::DynamicDataPin::id

Global unique UUID (e.g. "pin_inst_abc123")

Definition at line 48 of file DynamicDataPin.h.

Referenced by FromJson(), and ToJson().

◆ label

std::string Olympe::DynamicDataPin::label

Display label (set at construction)

Definition at line 51 of file DynamicDataPin.h.

Referenced by DynamicDataPin(), GetDisplayLabel(), and ToJson().

◆ nodePinID

std::string Olympe::DynamicDataPin::nodePinID

ImGui/ImNodes pin ID (assigned at render time)

Definition at line 52 of file DynamicDataPin.h.

Referenced by ToJson().

◆ position

OperandPosition Olympe::DynamicDataPin::position

Left or Right operand side.

Definition at line 50 of file DynamicDataPin.h.

Referenced by ToJson().

◆ sequenceNumber

int Olympe::DynamicDataPin::sequenceNumber

1-based sequence index across all pins on the node (for "Pin-in #N" label)

Definition at line 54 of file DynamicDataPin.h.

Referenced by GetShortLabel().


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