![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Command to paste nodes from clipboard with offset. More...
#include <BTGraphCommands.h>
Inheritance diagram for Olympe::PasteNodesCommand:
Collaboration diagram for Olympe::PasteNodesCommand:Public Member Functions | |
| PasteNodesCommand (NodeGraph *graph, float offsetX=30.0f, float offsetY=30.0f) | |
| virtual | ~PasteNodesCommand ()=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 |
| float | m_offsetX |
| float | m_offsetY |
| std::vector< int > | m_pastedNodeIds |
| std::map< int, int > | m_idMapping |
Command to paste nodes from clipboard with offset.
Definition at line 47 of file BTGraphCommands.h.
| Olympe::PasteNodesCommand::PasteNodesCommand | ( | NodeGraph * | graph, |
| float | offsetX = 30.0f, |
||
| float | offsetY = 30.0f |
||
| ) |
Definition at line 40 of file BTGraphCommands.cpp.
|
virtualdefault |
|
overridevirtual |
Execute the command (forward operation)
Implements Olympe::GraphCommand.
Definition at line 45 of file BTGraphCommands.cpp.
References m_graph, m_offsetX, m_offsetY, m_pastedNodeIds, and Olympe::NodeGraph::PasteNodesFromClipboard().
Here is the call graph for this function:
|
overridevirtual |
Get a human-readable description of the command.
Implements Olympe::GraphCommand.
Definition at line 68 of file BTGraphCommands.cpp.
References m_pastedNodeIds.
|
overridevirtual |
Undo the command (reverse operation)
Implements Olympe::GraphCommand.
Definition at line 54 of file BTGraphCommands.cpp.
References Olympe::NodeGraph::DeleteNode(), m_graph, and m_pastedNodeIds.
Here is the call graph for this function:
|
private |
Definition at line 58 of file BTGraphCommands.h.
Definition at line 61 of file BTGraphCommands.h.
|
private |
Definition at line 59 of file BTGraphCommands.h.
Referenced by Execute().
|
private |
Definition at line 59 of file BTGraphCommands.h.
Referenced by Execute().
|
private |
Definition at line 60 of file BTGraphCommands.h.
Referenced by Execute(), GetDescription(), and Undo().