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

#include <ComponentNodeData.h>

+ Collaboration diagram for Olympe::ComponentNode:

Public Member Functions

 ComponentNode ()
 
 ComponentNode (const std::string &type)
 
bool operator== (const ComponentNode &other) const
 
bool operator!= (const ComponentNode &other) const
 
std::string ToDisplayString () const
 
json ToJson () const
 
void SetProperty (const std::string &key, const std::string &value)
 
std::string GetProperty (const std::string &key) const
 
bool HasProperty (const std::string &key) const
 
Vector GetCurrentColor () const
 
void InitializePorts (uint32_t numInputPorts=1, uint32_t numOutputPorts=1)
 
const std::vector< NodePort > & GetPorts () const
 
std::vector< NodePort > & GetPorts ()
 
NodePortFindPort (PortId portId)
 
const NodePortFindPort (PortId portId) const
 

Static Public Member Functions

static ComponentNode FromJson (const json &data)
 

Public Attributes

NodeId nodeId = InvalidNodeId
 
std::string componentType
 
std::string componentName
 
Vector position
 
Vector size = Vector(150.0f, 80.0f, 0.0f)
 
bool selected = false
 
bool hovered = false
 
bool enabled = true
 
std::map< std::string, std::string > properties
 
ComponentNodeStyle style
 
std::vector< NodePortports
 

Detailed Description

Definition at line 84 of file ComponentNodeData.h.

Constructor & Destructor Documentation

◆ ComponentNode() [1/2]

Olympe::ComponentNode::ComponentNode ( )

Definition at line 10 of file ComponentNodeData.cpp.

References position, size, and Olympe::Vector.

◆ ComponentNode() [2/2]

Olympe::ComponentNode::ComponentNode ( const std::string &  type)
explicit

Definition at line 17 of file ComponentNodeData.cpp.

References position, size, and Olympe::Vector.

Member Function Documentation

◆ FindPort() [1/2]

NodePort * Olympe::ComponentNode::FindPort ( PortId  portId)

Definition at line 192 of file ComponentNodeData.cpp.

References GetComponentTypeID_Static(), and ports.

+ Here is the call graph for this function:

◆ FindPort() [2/2]

const NodePort * Olympe::ComponentNode::FindPort ( PortId  portId) const

Definition at line 204 of file ComponentNodeData.cpp.

References GetComponentTypeID_Static(), and ports.

+ Here is the call graph for this function:

◆ FromJson()

ComponentNode Olympe::ComponentNode::FromJson ( const json data)
static

Definition at line 76 of file ComponentNodeData.cpp.

References Olympe::NodePort::FromJson(), GetComponentTypeID_Static(), and nodeId.

+ Here is the call graph for this function:

◆ GetCurrentColor()

Vector Olympe::ComponentNode::GetCurrentColor ( ) const

◆ GetPorts() [1/2]

std::vector< NodePort > & Olympe::ComponentNode::GetPorts ( )

Definition at line 187 of file ComponentNodeData.cpp.

References ports.

◆ GetPorts() [2/2]

const std::vector< NodePort > & Olympe::ComponentNode::GetPorts ( ) const

Definition at line 182 of file ComponentNodeData.cpp.

References ports.

◆ GetProperty()

std::string Olympe::ComponentNode::GetProperty ( const std::string &  key) const

Definition at line 133 of file ComponentNodeData.cpp.

References GetComponentTypeID_Static(), and properties.

+ Here is the call graph for this function:

◆ HasProperty()

bool Olympe::ComponentNode::HasProperty ( const std::string &  key) const

Definition at line 143 of file ComponentNodeData.cpp.

References GetComponentTypeID_Static(), and properties.

+ Here is the call graph for this function:

◆ InitializePorts()

void Olympe::ComponentNode::InitializePorts ( uint32_t  numInputPorts = 1,
uint32_t  numOutputPorts = 1 
)

Definition at line 165 of file ComponentNodeData.cpp.

References GetComponentTypeID_Static(), nodeId, and ports.

+ Here is the call graph for this function:

◆ operator!=()

bool Olympe::ComponentNode::operator!= ( const ComponentNode other) const

Definition at line 29 of file ComponentNodeData.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ operator==()

bool Olympe::ComponentNode::operator== ( const ComponentNode other) const

Definition at line 24 of file ComponentNodeData.cpp.

References componentType, GetComponentTypeID_Static(), and nodeId.

+ Here is the call graph for this function:

◆ SetProperty()

void Olympe::ComponentNode::SetProperty ( const std::string &  key,
const std::string &  value 
)

Definition at line 128 of file ComponentNodeData.cpp.

References GetComponentTypeID_Static(), and properties.

+ Here is the call graph for this function:

◆ ToDisplayString()

std::string Olympe::ComponentNode::ToDisplayString ( ) const

Definition at line 34 of file ComponentNodeData.cpp.

References componentName, componentType, and enabled.

◆ ToJson()

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

Definition at line 48 of file ComponentNodeData.cpp.

References componentName, componentType, enabled, GetComponentTypeID_Static(), nodeId, ports, position, properties, selected, size, Vector::x, and Vector::y.

+ Here is the call graph for this function:

Member Data Documentation

◆ componentName

std::string Olympe::ComponentNode::componentName

Definition at line 88 of file ComponentNodeData.h.

Referenced by ToDisplayString(), and ToJson().

◆ componentType

std::string Olympe::ComponentNode::componentType

Definition at line 87 of file ComponentNodeData.h.

Referenced by operator==(), ToDisplayString(), and ToJson().

◆ enabled

bool Olympe::ComponentNode::enabled = true

Definition at line 93 of file ComponentNodeData.h.

Referenced by GetCurrentColor(), ToDisplayString(), and ToJson().

◆ hovered

bool Olympe::ComponentNode::hovered = false

Definition at line 92 of file ComponentNodeData.h.

Referenced by GetCurrentColor().

◆ nodeId

NodeId Olympe::ComponentNode::nodeId = InvalidNodeId

Definition at line 86 of file ComponentNodeData.h.

Referenced by FromJson(), InitializePorts(), operator==(), and ToJson().

◆ ports

std::vector<NodePort> Olympe::ComponentNode::ports

Definition at line 96 of file ComponentNodeData.h.

Referenced by FindPort(), FindPort(), GetPorts(), GetPorts(), InitializePorts(), and ToJson().

◆ position

Vector Olympe::ComponentNode::position

◆ properties

std::map<std::string, std::string> Olympe::ComponentNode::properties

Definition at line 94 of file ComponentNodeData.h.

Referenced by GetProperty(), HasProperty(), SetProperty(), and ToJson().

◆ selected

bool Olympe::ComponentNode::selected = false

Definition at line 91 of file ComponentNodeData.h.

Referenced by GetCurrentColor(), and ToJson().

◆ size

Vector Olympe::ComponentNode::size = Vector(150.0f, 80.0f, 0.0f)

Definition at line 90 of file ComponentNodeData.h.

Referenced by ComponentNode(), ComponentNode(), and ToJson().

◆ style

ComponentNodeStyle Olympe::ComponentNode::style

Definition at line 95 of file ComponentNodeData.h.

Referenced by GetCurrentColor().


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