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::DeleteNodeCommand Class Reference

Deletes a node from the graph. More...

#include <DeleteNodeCommand.h>

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

Public Member Functions

 DeleteNodeCommand (GraphDocument *graph, NodeId nodeId)
 
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
 
NodeId m_nodeId
 
NodeData m_savedNode
 
std::vector< LinkDatam_savedLinks
 
bool m_wasExecuted = false
 

Detailed Description

Deletes a node from the graph.

Definition at line 20 of file DeleteNodeCommand.h.

Constructor & Destructor Documentation

◆ DeleteNodeCommand()

Olympe::NodeGraph::DeleteNodeCommand::DeleteNodeCommand ( GraphDocument graph,
NodeId  nodeId 
)

Definition at line 13 of file DeleteNodeCommand.cpp.

Member Function Documentation

◆ Execute()

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

◆ GetDescription()

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

Get description of the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 56 of file DeleteNodeCommand.cpp.

◆ Undo()

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

Undo the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 44 of file DeleteNodeCommand.cpp.

References Olympe::NodeGraph::GraphDocument::GetNodesRef(), m_graph, m_savedNode, and m_wasExecuted.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_graph

GraphDocument* Olympe::NodeGraph::DeleteNodeCommand::m_graph
private

Definition at line 29 of file DeleteNodeCommand.h.

Referenced by Execute(), and Undo().

◆ m_nodeId

NodeId Olympe::NodeGraph::DeleteNodeCommand::m_nodeId
private

Definition at line 30 of file DeleteNodeCommand.h.

Referenced by Execute().

◆ m_savedLinks

std::vector<LinkData> Olympe::NodeGraph::DeleteNodeCommand::m_savedLinks
private

Definition at line 32 of file DeleteNodeCommand.h.

Referenced by Execute().

◆ m_savedNode

NodeData Olympe::NodeGraph::DeleteNodeCommand::m_savedNode
private

Definition at line 31 of file DeleteNodeCommand.h.

Referenced by Execute(), and Undo().

◆ m_wasExecuted

bool Olympe::NodeGraph::DeleteNodeCommand::m_wasExecuted = false
private

Definition at line 33 of file DeleteNodeCommand.h.

Referenced by Execute(), and Undo().


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