![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Manages undo/redo stacks for commands. More...
#include <CommandSystem.h>
Public Member Functions | |
| void | ExecuteCommand (std::unique_ptr< ICommand > cmd) |
| Execute a command and add to undo stack. | |
| void | Undo () |
| Undo the last command. | |
| void | Redo () |
| Redo the last undone command. | |
| bool | CanUndo () const |
| Check if undo is available. | |
| bool | CanRedo () const |
| Check if redo is available. | |
| std::string | GetUndoDescription () const |
| Get description of next undo command. | |
| std::string | GetRedoDescription () const |
| Get description of next redo command. | |
| void | Clear () |
| Clear all commands. | |
Private Attributes | |
| std::vector< std::unique_ptr< ICommand > > | m_undoStack |
| std::vector< std::unique_ptr< ICommand > > | m_redoStack |
Static Private Attributes | |
| static const size_t | MAX_STACK_SIZE = 100 |
Manages undo/redo stacks for commands.
Definition at line 48 of file CommandSystem.h.
| bool Olympe::NodeGraph::CommandStack::CanRedo | ( | ) | const |
Check if redo is available.
Definition at line 67 of file CommandSystem.cpp.
References m_redoStack.
Referenced by Olympe::AI::AIEditorGUI::MenuAction_Redo(), Redo(), and Olympe::AI::AIEditorGUI::RenderMenuBar().
Here is the caller graph for this function:| bool Olympe::NodeGraph::CommandStack::CanUndo | ( | ) | const |
Check if undo is available.
Definition at line 62 of file CommandSystem.cpp.
References m_undoStack.
Referenced by Olympe::AI::AIEditorGUI::MenuAction_Undo(), Olympe::AI::AIEditorGUI::RenderMenuBar(), and Undo().
Here is the caller graph for this function:| void Olympe::NodeGraph::CommandStack::Clear | ( | ) |
Clear all commands.
Definition at line 88 of file CommandSystem.cpp.
References m_redoStack, and m_undoStack.
Referenced by Olympe::AI::AIEditorGUI::Shutdown().
Here is the caller graph for this function:Execute a command and add to undo stack.
| cmd | Command to execute |
Definition at line 17 of file CommandSystem.cpp.
References GetComponentTypeID_Static(), m_redoStack, m_undoStack, and MAX_STACK_SIZE.
Referenced by Olympe::AI::AIEditorGUI::Update().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string Olympe::NodeGraph::CommandStack::GetRedoDescription | ( | ) | const |
Get description of next redo command.
Definition at line 80 of file CommandSystem.cpp.
References m_redoStack.
Referenced by Olympe::AI::AIEditorGUI::MenuAction_Redo().
Here is the caller graph for this function:| std::string Olympe::NodeGraph::CommandStack::GetUndoDescription | ( | ) | const |
Get description of next undo command.
Definition at line 72 of file CommandSystem.cpp.
References m_undoStack.
Referenced by Olympe::AI::AIEditorGUI::MenuAction_Undo().
Here is the caller graph for this function:| void Olympe::NodeGraph::CommandStack::Redo | ( | ) |
Redo the last undone command.
Definition at line 49 of file CommandSystem.cpp.
References CanRedo(), GetComponentTypeID_Static(), m_redoStack, and m_undoStack.
Referenced by Olympe::AI::AIEditorGUI::MenuAction_Redo().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::NodeGraph::CommandStack::Undo | ( | ) |
Undo the last command.
Definition at line 36 of file CommandSystem.cpp.
References CanUndo(), GetComponentTypeID_Static(), m_redoStack, and m_undoStack.
Referenced by Olympe::AI::AIEditorGUI::MenuAction_Undo().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 93 of file CommandSystem.h.
Referenced by CanRedo(), Clear(), ExecuteCommand(), GetRedoDescription(), Redo(), and Undo().
|
private |
Definition at line 92 of file CommandSystem.h.
Referenced by CanUndo(), Clear(), ExecuteCommand(), GetUndoDescription(), Redo(), and Undo().
Definition at line 94 of file CommandSystem.h.
Referenced by ExecuteCommand().