X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fshared%2FCLI.hpp;fp=src%2Fshared%2FCLI.hpp;h=b601e572d554af0ffa8cd1e274e4c0f3541388b8;hb=10a310869c61cc52046e165f36ac9639fe9d0c69;hp=0000000000000000000000000000000000000000;hpb=69e4d6c0a86a27f9b3f1297e46c55b36059a24b9;p=blank.git diff --git a/src/shared/CLI.hpp b/src/shared/CLI.hpp new file mode 100644 index 0000000..b601e57 --- /dev/null +++ b/src/shared/CLI.hpp @@ -0,0 +1,41 @@ +#ifndef BLANK_SHARED_CLI_HPP_ +#define BLANK_SHARED_CLI_HPP_ + +#include +#include + + +namespace blank { + +class Player; +class TokenStreamReader; +class World; + +class CLI { + +public: + struct Command { + virtual ~Command(); + virtual void Execute(CLI &, Player &, TokenStreamReader &) = 0; + }; + +public: + explicit CLI(World &); + ~CLI(); + + void AddCommand(const std::string &name, Command *); + + void Execute(Player &, const std::string &); + + void Message(const std::string &msg); + void Error(const std::string &msg); + +private: + World &world; + std::map commands; + +}; + +} + +#endif