![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Command to duplicate selected nodes (copy + paste in one action) More...
#include <BTGraphCommands.h>
Inheritance diagram for Olympe::DuplicateNodeCommand:
Collaboration diagram for Olympe::DuplicateNodeCommand:Public Member Functions | |
| DuplicateNodeCommand (NodeGraph *graph, const std::vector< int > &nodeIds, float offsetX=30.0f, float offsetY=30.0f) | |
| virtual | ~DuplicateNodeCommand ()=default |
| bool | Execute () override |
| Execute the command (forward operation) | |
| bool | Undo () override |
| Undo the command (reverse operation) | |
| std::string | GetDescription () const override |
| Get a human-readable description of the command. | |
Public Member Functions inherited from Olympe::GraphCommand | |
| virtual | ~GraphCommand ()=default |
| virtual bool | CanMergeWith (const GraphCommand &other) const |
| Check if this command can be merged with another Used for combining consecutive similar commands (e.g., multiple position changes) | |
| virtual bool | MergeWith (const GraphCommand &other) |
| Merge this command with another Called only if CanMergeWith returned true. | |
Private Attributes | |
| NodeGraph * | m_graph |
| std::vector< int > | m_originalNodeIds |
| std::vector< int > | m_duplicatedNodeIds |
| float | m_offsetX |
| float | m_offsetY |
Command to duplicate selected nodes (copy + paste in one action)
Definition at line 68 of file BTGraphCommands.h.
| Olympe::DuplicateNodeCommand::DuplicateNodeCommand | ( | NodeGraph * | graph, |
| const std::vector< int > & | nodeIds, | ||
| float | offsetX = 30.0f, |
||
| float | offsetY = 30.0f |
||
| ) |
Definition at line 74 of file BTGraphCommands.cpp.
|
virtualdefault |
|
overridevirtual |
Execute the command (forward operation)
Implements Olympe::GraphCommand.
Definition at line 79 of file BTGraphCommands.cpp.
References Olympe::NodeGraph::DuplicateNodes(), m_duplicatedNodeIds, m_graph, m_offsetX, m_offsetY, and m_originalNodeIds.
Here is the call graph for this function:
|
overridevirtual |
Get a human-readable description of the command.
Implements Olympe::GraphCommand.
Definition at line 102 of file BTGraphCommands.cpp.
References m_originalNodeIds.
|
overridevirtual |
Undo the command (reverse operation)
Implements Olympe::GraphCommand.
Definition at line 88 of file BTGraphCommands.cpp.
References Olympe::NodeGraph::DeleteNode(), m_duplicatedNodeIds, and m_graph.
Here is the call graph for this function:
|
private |
Definition at line 81 of file BTGraphCommands.h.
|
private |
Definition at line 79 of file BTGraphCommands.h.
|
private |
Definition at line 82 of file BTGraphCommands.h.
Referenced by Execute().
|
private |
Definition at line 82 of file BTGraphCommands.h.
Referenced by Execute().
|
private |
Definition at line 80 of file BTGraphCommands.h.
Referenced by Execute(), and GetDescription().