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

CommandStack - Manages undo/redo command history Maintains two stacks for undo and redo operations. More...

#include <CommandSystem.h>

Public Member Functions

 CommandStack ()
 
 ~CommandStack ()
 
void ExecuteCommand (std::unique_ptr< EditorCommand > cmd)
 
void Undo ()
 
void Redo ()
 
bool CanUndo () const
 
bool CanRedo () const
 
const EditorCommandGetLastCommand () const
 
std::string GetLastCommandDescription () const
 
std::string GetNextRedoDescription () const
 
std::vector< std::string > GetUndoStackDescriptions () const
 
std::vector< std::string > GetRedoStackDescriptions () const
 
void Clear ()
 
size_t GetUndoStackSize () const
 
size_t GetRedoStackSize () const
 

Private Attributes

std::vector< std::unique_ptr< EditorCommand > > m_UndoStack
 
std::vector< std::unique_ptr< EditorCommand > > m_RedoStack
 
size_t m_MaxStackSize
 

Detailed Description

CommandStack - Manages undo/redo command history Maintains two stacks for undo and redo operations.

Definition at line 45 of file CommandSystem.h.

Constructor & Destructor Documentation

◆ CommandStack()

Olympe::CommandStack::CommandStack ( )

Definition at line 15 of file CommandSystem.cpp.

◆ ~CommandStack()

Olympe::CommandStack::~CommandStack ( )

Definition at line 20 of file CommandSystem.cpp.

References Clear().

+ Here is the call graph for this function:

Member Function Documentation

◆ CanRedo()

bool Olympe::CommandStack::CanRedo ( ) const
inline

Definition at line 62 of file CommandSystem.h.

References m_RedoStack.

Referenced by Olympe::BlueprintEditor::CanRedo().

+ Here is the caller graph for this function:

◆ CanUndo()

bool Olympe::CommandStack::CanUndo ( ) const
inline

Definition at line 61 of file CommandSystem.h.

References m_UndoStack.

Referenced by Olympe::BlueprintEditor::CanUndo().

+ Here is the caller graph for this function:

◆ Clear()

void Olympe::CommandStack::Clear ( )

Definition at line 137 of file CommandSystem.cpp.

References m_RedoStack, and m_UndoStack.

Referenced by ~CommandStack().

+ Here is the caller graph for this function:

◆ ExecuteCommand()

void Olympe::CommandStack::ExecuteCommand ( std::unique_ptr< EditorCommand cmd)

Definition at line 25 of file CommandSystem.cpp.

References GetComponentTypeID_Static(), m_MaxStackSize, m_RedoStack, and m_UndoStack.

Referenced by Olympe::NodeGraphPanel::HandleKeyboardShortcuts(), Olympe::NodeGraphPanel::HandleNodeInteractions(), and Olympe::NodeGraphPanel::RenderGraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLastCommand()

const EditorCommand * Olympe::CommandStack::GetLastCommand ( ) const

Definition at line 90 of file CommandSystem.cpp.

References m_UndoStack.

◆ GetLastCommandDescription()

std::string Olympe::CommandStack::GetLastCommandDescription ( ) const

Definition at line 99 of file CommandSystem.cpp.

References Olympe::EditorCommand::GetDescription(), and m_UndoStack.

Referenced by Olympe::BlueprintEditor::GetLastCommandDescription().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNextRedoDescription()

std::string Olympe::CommandStack::GetNextRedoDescription ( ) const

Definition at line 108 of file CommandSystem.cpp.

References m_RedoStack.

Referenced by Olympe::BlueprintEditor::GetNextRedoDescription().

+ Here is the caller graph for this function:

◆ GetRedoStackDescriptions()

std::vector< std::string > Olympe::CommandStack::GetRedoStackDescriptions ( ) const

Definition at line 127 of file CommandSystem.cpp.

References GetComponentTypeID_Static(), and m_RedoStack.

+ Here is the call graph for this function:

◆ GetRedoStackSize()

size_t Olympe::CommandStack::GetRedoStackSize ( ) const
inline

Definition at line 78 of file CommandSystem.h.

References m_RedoStack.

◆ GetUndoStackDescriptions()

std::vector< std::string > Olympe::CommandStack::GetUndoStackDescriptions ( ) const

Definition at line 117 of file CommandSystem.cpp.

References GetComponentTypeID_Static(), and m_UndoStack.

+ Here is the call graph for this function:

◆ GetUndoStackSize()

size_t Olympe::CommandStack::GetUndoStackSize ( ) const
inline

Definition at line 77 of file CommandSystem.h.

References m_UndoStack.

◆ Redo()

void Olympe::CommandStack::Redo ( )

Definition at line 70 of file CommandSystem.cpp.

References GetComponentTypeID_Static(), m_RedoStack, and m_UndoStack.

Referenced by Olympe::BlueprintEditor::Redo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Undo()

void Olympe::CommandStack::Undo ( )

Definition at line 50 of file CommandSystem.cpp.

References GetComponentTypeID_Static(), m_RedoStack, and m_UndoStack.

Referenced by Olympe::BlueprintEditor::Undo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_MaxStackSize

size_t Olympe::CommandStack::m_MaxStackSize
private

Definition at line 83 of file CommandSystem.h.

Referenced by ExecuteCommand().

◆ m_RedoStack

std::vector<std::unique_ptr<EditorCommand> > Olympe::CommandStack::m_RedoStack
private

◆ m_UndoStack

std::vector<std::unique_ptr<EditorCommand> > Olympe::CommandStack::m_UndoStack
private

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