Open Source Tomb Raider Engine
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Command.h 613B

123456789101112131415161718192021222324252627282930313233
  1. /*!
  2. * \file include/commands/Command.h
  3. * \brief Command interface
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _COMMAND_H_
  8. #define _COMMAND_H_
  9. #include <istream>
  10. #include <memory>
  11. #include <string>
  12. #include <vector>
  13. class Command {
  14. public:
  15. virtual ~Command();
  16. virtual std::string name() = 0;
  17. virtual std::string brief() = 0;
  18. virtual void printHelp();
  19. virtual int execute(std::istream& args) = 0;
  20. static void fillCommandList();
  21. static int command(std::string c);
  22. static int executeFile(std::string file);
  23. private:
  24. static std::vector<std::shared_ptr<Command>> commands;
  25. };
  26. #endif