#include <Command.h>
Definition at line 39 of file Command.h.
◆ Execute()
| void Elevate::CommandManager::Execute |
( |
std::unique_ptr< Command > |
command | ) |
|
|
protected |
Definition at line 16 of file Command.cpp.
17{
18 EE_CORE_TRACE("Execute");
19 command->Execute();
20
21 if (command->IsUndoable())
22 {
23 m_undoStack.push(std::move(command));
24
25
26 std::stack<std::unique_ptr<Command>> empty;
27 m_redoStack.swap(empty);
28 }
29}
◆ ExecuteStack()
| void Elevate::CommandManager::ExecuteStack |
( |
| ) |
|
|
protected |
Definition at line 5 of file Command.cpp.
6{
7 while (!m_executeStack.empty())
8 {
9 EE_CORE_TRACE("ExecuteStack while loop iteration");
10 auto command = std::move(m_executeStack.top());
11 m_executeStack.pop();
13 }
14}
void Execute(std::unique_ptr< Command > command)
◆ PushCommand()
| void Elevate::CommandManager::PushCommand |
( |
std::unique_ptr< Command > |
command | ) |
|
|
inline |
Definition at line 42 of file Command.h.
43 {
44 m_executeStack.push(std::move(command));
45 }
◆ Redo()
| void Elevate::CommandManager::Redo |
( |
| ) |
|
|
protected |
Definition at line 50 of file Command.cpp.
51{
52 if (!m_redoStack.empty())
53 {
54 auto cmd = std::move(m_redoStack.top());
55 m_redoStack.pop();
57 }
58}
void PushCommand(std::unique_ptr< Command > command)
◆ Undo()
| void Elevate::CommandManager::Undo |
( |
| ) |
|
|
protected |
Definition at line 31 of file Command.cpp.
32{
33 if (!m_undoStack.empty())
34 {
35 while (!m_undoStack.empty() && !m_undoStack.top()->IsUndoable())
36 {
37 m_undoStack.pop();
38 }
39
40 if (!m_undoStack.empty())
41 {
42 auto cmd = std::move(m_undoStack.top());
43 m_undoStack.pop();
44 cmd->Undo();
45 m_redoStack.push(std::move(cmd));
46 }
47 }
48}
The documentation for this class was generated from the following files: