Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Olympe::NodeGraph::ConnectPinsCommand Class Reference

Creates a link between two pins. More...

#include <ConnectPinsCommand.h>

+ Inheritance diagram for Olympe::NodeGraph::ConnectPinsCommand:
+ Collaboration diagram for Olympe::NodeGraph::ConnectPinsCommand:

Public Member Functions

 ConnectPinsCommand (GraphDocument *graph, PinId fromPin, PinId toPin)
 
void Execute () override
 Execute the command.
 
void Undo () override
 Undo the command.
 
std::string GetDescription () const override
 Get description of the command.
 
- Public Member Functions inherited from Olympe::NodeGraph::ICommand
virtual ~ICommand ()=default
 

Private Attributes

GraphDocumentm_graph
 
PinId m_fromPin
 
PinId m_toPin
 
LinkId m_createdLinkId
 

Detailed Description

Creates a link between two pins.

Definition at line 20 of file ConnectPinsCommand.h.

Constructor & Destructor Documentation

◆ ConnectPinsCommand()

Olympe::NodeGraph::ConnectPinsCommand::ConnectPinsCommand ( GraphDocument graph,
PinId  fromPin,
PinId  toPin 
)

Definition at line 13 of file ConnectPinsCommand.cpp.

Member Function Documentation

◆ Execute()

void Olympe::NodeGraph::ConnectPinsCommand::Execute ( )
overridevirtual

Execute the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 20 of file ConnectPinsCommand.cpp.

References Olympe::NodeGraph::GraphDocument::ConnectPins(), m_createdLinkId, m_fromPin, m_graph, and m_toPin.

+ Here is the call graph for this function:

◆ GetDescription()

std::string Olympe::NodeGraph::ConnectPinsCommand::GetDescription ( ) const
overridevirtual

Get description of the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 36 of file ConnectPinsCommand.cpp.

◆ Undo()

void Olympe::NodeGraph::ConnectPinsCommand::Undo ( )
overridevirtual

Undo the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 28 of file ConnectPinsCommand.cpp.

References Olympe::NodeGraph::GraphDocument::DisconnectLink(), m_createdLinkId, m_graph, and Olympe::NodeGraph::LinkId::value.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_createdLinkId

LinkId Olympe::NodeGraph::ConnectPinsCommand::m_createdLinkId
private

Definition at line 32 of file ConnectPinsCommand.h.

Referenced by Execute(), and Undo().

◆ m_fromPin

PinId Olympe::NodeGraph::ConnectPinsCommand::m_fromPin
private

Definition at line 30 of file ConnectPinsCommand.h.

Referenced by Execute().

◆ m_graph

GraphDocument* Olympe::NodeGraph::ConnectPinsCommand::m_graph
private

Definition at line 29 of file ConnectPinsCommand.h.

Referenced by Execute(), and Undo().

◆ m_toPin

PinId Olympe::NodeGraph::ConnectPinsCommand::m_toPin
private

Definition at line 31 of file ConnectPinsCommand.h.

Referenced by Execute().


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