![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Abstract base class for all graph modification commands. More...
#include <GraphCommand.h>
Inheritance diagram for Olympe::GraphCommand:Public Member Functions | |
| virtual | ~GraphCommand ()=default |
| virtual bool | Execute ()=0 |
| Execute the command (forward operation) | |
| virtual bool | Undo ()=0 |
| Undo the command (reverse operation) | |
| virtual std::string | GetDescription () const =0 |
| Get a human-readable description of the command. | |
| 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. | |
Abstract base class for all graph modification commands.
Implements the Command Pattern for undo/redo functionality. Each command represents a single, undoable action on the graph.
Definition at line 22 of file GraphCommand.h.
|
virtualdefault |
|
inlinevirtual |
Check if this command can be merged with another Used for combining consecutive similar commands (e.g., multiple position changes)
| other | The other command to potentially merge with |
Definition at line 51 of file GraphCommand.h.
Execute the command (forward operation)
Implemented in Olympe::CopyNodesCommand, Olympe::PasteNodesCommand, and Olympe::DuplicateNodeCommand.
|
pure virtual |
Get a human-readable description of the command.
Implemented in Olympe::CopyNodesCommand, Olympe::PasteNodesCommand, and Olympe::DuplicateNodeCommand.
Referenced by Olympe::CommandHistory::GetUndoDescription().
Here is the caller graph for this function:
|
inlinevirtual |
Merge this command with another Called only if CanMergeWith returned true.
| other | The command to merge with |
Definition at line 62 of file GraphCommand.h.
Undo the command (reverse operation)
Implemented in Olympe::CopyNodesCommand, Olympe::PasteNodesCommand, and Olympe::DuplicateNodeCommand.