X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fshared%2FCLIContext.hpp;fp=src%2Fshared%2FCLIContext.hpp;h=8de432b7788adb966e0a890e45111e868290b0ca;hb=fa3c4a14546d73ddc2671cd5cc58208839bf7173;hp=0000000000000000000000000000000000000000;hpb=bc171dfe0897bccbbf9d9114d128be0801a1aff9;p=blank.git diff --git a/src/shared/CLIContext.hpp b/src/shared/CLIContext.hpp new file mode 100644 index 0000000..8de432b --- /dev/null +++ b/src/shared/CLIContext.hpp @@ -0,0 +1,38 @@ +#ifndef BLANK_SHARED_CLICONTEXT_HPP_ +#define BLANK_SHARED_CLICONTEXT_HPP_ + +#include + + +namespace blank { + +class Player; + +class CLIContext { + +public: + explicit CLIContext(Player &p) + : player(p) { } + + /// get the player responsible for all this + Player &GetPlayer() { return player; } + + /// an error has happened and the player should be notified + virtual void Error(const std::string &) = 0; + + /// return to sender + /// use this for output concerning the originator of a command + virtual void Message(const std::string &) = 0; + + /// send a status message to all players + /// use this to announce stuff which may be interesting to anyone + virtual void Broadcast(const std::string &) = 0; + +private: + Player &player; + +}; + +} + +#endif