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

Moves a node to a new position. More...

#include <MoveNodeCommand.h>

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

Public Member Functions

 MoveNodeCommand (GraphDocument *graph, NodeId nodeId, Vector2 oldPos, Vector2 newPos)
 
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
 
Vector2 m_oldPosition
 
Vector2 m_newPosition
 

Detailed Description

Moves a node to a new position.

Definition at line 20 of file MoveNodeCommand.h.

Constructor & Destructor Documentation

◆ MoveNodeCommand()

Olympe::NodeGraph::MoveNodeCommand::MoveNodeCommand ( GraphDocument graph,
NodeId  nodeId,
Vector2  oldPos,
Vector2  newPos 
)

Definition at line 13 of file MoveNodeCommand.cpp.

Member Function Documentation

◆ Execute()

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

Execute the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 21 of file MoveNodeCommand.cpp.

References m_graph, m_newPosition, m_nodeId, and Olympe::NodeGraph::GraphDocument::UpdateNodePosition().

+ Here is the call graph for this function:

◆ GetDescription()

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

Get description of the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 37 of file MoveNodeCommand.cpp.

◆ Undo()

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

Undo the command.

Implements Olympe::NodeGraph::ICommand.

Definition at line 29 of file MoveNodeCommand.cpp.

References m_graph, m_nodeId, m_oldPosition, and Olympe::NodeGraph::GraphDocument::UpdateNodePosition().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_graph

GraphDocument* Olympe::NodeGraph::MoveNodeCommand::m_graph
private

Definition at line 29 of file MoveNodeCommand.h.

Referenced by Execute(), and Undo().

◆ m_newPosition

Vector2 Olympe::NodeGraph::MoveNodeCommand::m_newPosition
private

Definition at line 32 of file MoveNodeCommand.h.

Referenced by Execute().

◆ m_nodeId

NodeId Olympe::NodeGraph::MoveNodeCommand::m_nodeId
private

Definition at line 30 of file MoveNodeCommand.h.

Referenced by Execute(), and Undo().

◆ m_oldPosition

Vector2 Olympe::NodeGraph::MoveNodeCommand::m_oldPosition
private

Definition at line 31 of file MoveNodeCommand.h.

Referenced by Undo().


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