Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Olympe::GraphCommand Class Referenceabstract

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~GraphCommand()

virtual Olympe::GraphCommand::~GraphCommand ( )
virtualdefault

Member Function Documentation

◆ CanMergeWith()

virtual bool Olympe::GraphCommand::CanMergeWith ( const GraphCommand other) const
inlinevirtual

Check if this command can be merged with another Used for combining consecutive similar commands (e.g., multiple position changes)

Parameters
otherThe other command to potentially merge with
Returns
true if commands can be merged

Definition at line 51 of file GraphCommand.h.

◆ Execute()

virtual bool Olympe::GraphCommand::Execute ( )
pure virtual

Execute the command (forward operation)

Returns
true if execution succeeded

Implemented in Olympe::CopyNodesCommand, Olympe::PasteNodesCommand, and Olympe::DuplicateNodeCommand.

◆ GetDescription()

virtual std::string Olympe::GraphCommand::GetDescription ( ) const
pure virtual

Get a human-readable description of the command.

Returns
Command description for UI display (e.g., "Create Action Node")

Implemented in Olympe::CopyNodesCommand, Olympe::PasteNodesCommand, and Olympe::DuplicateNodeCommand.

Referenced by Olympe::CommandHistory::GetUndoDescription().

+ Here is the caller graph for this function:

◆ MergeWith()

virtual bool Olympe::GraphCommand::MergeWith ( const GraphCommand other)
inlinevirtual

Merge this command with another Called only if CanMergeWith returned true.

Parameters
otherThe command to merge with
Returns
true if merge succeeded

Definition at line 62 of file GraphCommand.h.

◆ Undo()

virtual bool Olympe::GraphCommand::Undo ( )
pure virtual

Undo the command (reverse operation)

Returns
true if undo succeeded

Implemented in Olympe::CopyNodesCommand, Olympe::PasteNodesCommand, and Olympe::DuplicateNodeCommand.


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