diff --git a/src/app/editor/system/command_manager.h b/src/app/editor/system/command_manager.h new file mode 100644 index 00000000..4a36397b --- /dev/null +++ b/src/app/editor/system/command_manager.h @@ -0,0 +1,35 @@ +#ifndef YAZE_APP_EDITOR_SYSTEM_COMMAND_MANAGER_H +#define YAZE_APP_EDITOR_SYSTEM_COMMAND_MANAGER_H + +#include +#include + +namespace yaze { +namespace app { +namespace editor { + +class Command { + public: + virtual ~Command() = default; + virtual void Execute() = 0; +}; + +class CommandManager { + public: + void RegisterCommand(const std::string& shortcut, Command* command) { + commands_[shortcut] = command; + } + + void ExecuteCommand(const std::string& shortcut) { + if (commands_.find(shortcut) != commands_.end()) { + commands_[shortcut]->Execute(); + } + } + + private: + std::unordered_map commands_; +}; + +} // namespace editor +} // namespace app +} // namespace yaze \ No newline at end of file