| 19 | } |
| 20 | |
| 21 | bool CommandManager::AddCommand(std::shared_ptr<AppCommand> command, bool execute) { |
| 22 | if (execute) |
| 23 | if (!command->Execute()) |
| 24 | return false; |
| 25 | |
| 26 | if (!_enabled) |
| 27 | return true; |
| 28 | |
| 29 | _undoList.push_back(command); |
| 30 | _redoList.clear(); |
| 31 | return true; |
| 32 | } |
| 33 | |
| 34 | bool CommandManager::Undo() { |
| 35 | if (!CanUndo()) |