CommandManager.h 577 B

1234567891011121314151617181920212223
  1. #ifndef COMMANDMANAGER_H
  2. #define COMMANDMANAGER_H
  3. #include <unordered_map>
  4. #include <vector>
  5. #include "server/commands/ICommandSource.h"
  6. class CommandManager
  7. {
  8. public:
  9. CommandManager();
  10. void execute(IGameServer& gs, ICommandSource& cs, const std::string& rawCommand) const;
  11. private:
  12. std::unordered_map<std::string, void (*) (IGameServer& gs, ICommandSource&, const std::vector<std::string>&)> commands;
  13. void registerCommand(const std::string& name, void (*command) (IGameServer& gs, ICommandSource&, const std::vector<std::string>&));
  14. };
  15. #endif