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

Creates a new node in the graph. More...

#include <CreateNodeCommand.h>

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

Public Member Functions

 CreateNodeCommand (GraphDocument *graph, const std::string &nodeType, Vector2 position)
 
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
 
std::string m_nodeType
 
Vector2 m_position
 
NodeId m_createdNodeId
 

Detailed Description

Creates a new node in the graph.

Definition at line 20 of file CreateNodeCommand.h.

Constructor & Destructor Documentation

◆ CreateNodeCommand()

Olympe::NodeGraph::CreateNodeCommand::CreateNodeCommand ( GraphDocument graph,
const std::string &  nodeType,
Vector2  position 
)

Definition at line 13 of file CreateNodeCommand.cpp.

Member Function Documentation

◆ Execute()

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

Execute the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 20 of file CreateNodeCommand.cpp.

References Olympe::NodeGraph::GraphDocument::CreateNode(), m_createdNodeId, m_graph, m_nodeType, and m_position.

+ Here is the call graph for this function:

◆ GetDescription()

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

Get description of the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 36 of file CreateNodeCommand.cpp.

References m_nodeType.

◆ Undo()

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

Undo the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 28 of file CreateNodeCommand.cpp.

References Olympe::NodeGraph::GraphDocument::DeleteNode(), m_createdNodeId, m_graph, and Olympe::NodeGraph::NodeId::value.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_createdNodeId

NodeId Olympe::NodeGraph::CreateNodeCommand::m_createdNodeId
private

Definition at line 32 of file CreateNodeCommand.h.

Referenced by Execute(), and Undo().

◆ m_graph

GraphDocument* Olympe::NodeGraph::CreateNodeCommand::m_graph
private

Definition at line 29 of file CreateNodeCommand.h.

Referenced by Execute(), and Undo().

◆ m_nodeType

std::string Olympe::NodeGraph::CreateNodeCommand::m_nodeType
private

Definition at line 30 of file CreateNodeCommand.h.

Referenced by Execute(), and GetDescription().

◆ m_position

Vector2 Olympe::NodeGraph::CreateNodeCommand::m_position
private

Definition at line 31 of file CreateNodeCommand.h.

Referenced by Execute().


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