![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
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 | |
| GraphDocument * | m_graph |
| std::string | m_nodeType |
| Vector2 | m_position |
| NodeId | m_createdNodeId |
Creates a new node in the graph.
Definition at line 20 of file CreateNodeCommand.h.
| Olympe::NodeGraph::CreateNodeCommand::CreateNodeCommand | ( | GraphDocument * | graph, |
| const std::string & | nodeType, | ||
| Vector2 | position | ||
| ) |
Definition at line 13 of file CreateNodeCommand.cpp.
|
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:
|
overridevirtual |
Get description of the command.
Implements Olympe::NodeGraph::ICommand.
Definition at line 36 of file CreateNodeCommand.cpp.
References m_nodeType.
|
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:
|
private |
Definition at line 32 of file CreateNodeCommand.h.
|
private |
Definition at line 29 of file CreateNodeCommand.h.
|
private |
Definition at line 30 of file CreateNodeCommand.h.
Referenced by Execute(), and GetDescription().
|
private |
Definition at line 31 of file CreateNodeCommand.h.
Referenced by Execute().