CommandManager.h 473 B

1234567891011121314151617181920212223242526
  1. #ifndef COMMANDMANAGER_H
  2. #define COMMANDMANAGER_H
  3. #include <iostream>
  4. #include <unordered_map>
  5. #include "server/commands/BaseCommand.h"
  6. #include <memory>
  7. using namespace std;
  8. class CommandManager
  9. {
  10. public:
  11. CommandManager();
  12. virtual ~CommandManager();
  13. void execute(ICommandSource& cs, const string& rawCommand) const;
  14. private:
  15. unordered_map<string, unique_ptr<BaseCommand>> commands;
  16. void registerCommand(BaseCommand* command);
  17. };
  18. #endif