Class that keeps track of all commands that have been run. Allows functionality for undo/redo.
More...
|
unsigned int | Size () const |
| Returns the number of currently stored actions.
|
|
unsigned int | MaxSize () const |
| Returns the maximum number of undoes stored.
|
|
void | SetMaxSize (unsigned int maxSize) |
| Sets the maximum number of undoes.
|
|
ActionNode * | GetAction (int index) |
| Returns the node at the given index or nullptr if the index does not exist. Returns the last node for a negative index.
|
|
ActionNode * | GetCurAction () const |
| Returns the most recent action.
|
|
void | Undo () |
| Attempts to undo the most recent command. Does nothing if the most recent command cannot be undone.
|
|
void | Redo () |
| Attempts to redo the most recently undone command. Does nothing if used without undo.
|
|
void | Execute (ICommand *command) |
| Executes the given command, emplacing it as the most recent item in the stack.
|
|
void | Save () |
| Saves the current state of the action stack.
|
|
bool | IsSaved () const |
| Returns whether the action stack is equal to the most recent save state.
|
|
void | Clear () |
| Clears the action stack.
|
|
| ActionStack (unsigned int maxUndo=50) |
| Constructs a new action stack with no actions.
|
|
| ~ActionStack () |
| Destructs the whole action stack.
|
|
Class that keeps track of all commands that have been run. Allows functionality for undo/redo.