![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Manages undo/redo stacks for editor commands. More...
#include <BTEditorCommand.h>
Public Member Functions | |
| void | Execute (std::unique_ptr< BTEditorCommand > cmd) |
| Execute a command and add it to the 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 the next undo command. | |
| std::string | GetRedoDescription () const |
| Get description of the next redo command. | |
| void | Clear () |
| Clear all commands. | |
Private Attributes | |
| std::vector< std::unique_ptr< BTEditorCommand > > | m_undoStack |
| std::vector< std::unique_ptr< BTEditorCommand > > | m_redoStack |
Static Private Attributes | |
| static const size_t | kMaxStackSize = 100 |
Manages undo/redo stacks for editor commands.
Definition at line 51 of file BTEditorCommand.h.
| bool Olympe::BTCommandStack::CanRedo | ( | ) | const |
Check if redo is available.
Definition at line 66 of file BTEditorCommand.cpp.
References m_redoStack.
Referenced by GetRedoDescription(), Redo(), and Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow().
Here is the caller graph for this function:| bool Olympe::BTCommandStack::CanUndo | ( | ) | const |
Check if undo is available.
Definition at line 61 of file BTEditorCommand.cpp.
References m_undoStack.
Referenced by GetUndoDescription(), Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow(), and Undo().
Here is the caller graph for this function:| void Olympe::BTCommandStack::Clear | ( | ) |
Clear all commands.
Definition at line 87 of file BTEditorCommand.cpp.
References m_redoStack, and m_undoStack.
| void Olympe::BTCommandStack::Execute | ( | std::unique_ptr< BTEditorCommand > | cmd | ) |
Execute a command and add it to the undo stack.
| cmd | Command to execute |
Definition at line 16 of file BTEditorCommand.cpp.
References GetComponentTypeID_Static(), kMaxStackSize, m_redoStack, and m_undoStack.
Here is the call graph for this function:| std::string Olympe::BTCommandStack::GetRedoDescription | ( | ) | const |
Get description of the next redo command.
Definition at line 79 of file BTEditorCommand.cpp.
References CanRedo(), and m_redoStack.
Here is the call graph for this function:| std::string Olympe::BTCommandStack::GetUndoDescription | ( | ) | const |
Get description of the next undo command.
Definition at line 71 of file BTEditorCommand.cpp.
References CanUndo(), and m_undoStack.
Here is the call graph for this function:| void Olympe::BTCommandStack::Redo | ( | ) |
Redo the last undone command.
Definition at line 48 of file BTEditorCommand.cpp.
References CanRedo(), GetComponentTypeID_Static(), m_redoStack, and m_undoStack.
Referenced by Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::BTCommandStack::Undo | ( | ) |
Undo the last command.
Definition at line 35 of file BTEditorCommand.cpp.
References CanUndo(), GetComponentTypeID_Static(), m_redoStack, and m_undoStack.
Referenced by Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 98 of file BTEditorCommand.h.
Referenced by Execute().
|
private |
Definition at line 97 of file BTEditorCommand.h.
Referenced by CanRedo(), Clear(), Execute(), GetRedoDescription(), Redo(), and Undo().
|
private |
Definition at line 96 of file BTEditorCommand.h.
Referenced by CanUndo(), Clear(), Execute(), GetUndoDescription(), Redo(), and Undo().