]> git.localhorst.tv Git - blank.git/blobdiff - src/shared/CLIContext.hpp
make command output visible to player(s)
[blank.git] / src / shared / CLIContext.hpp
diff --git a/src/shared/CLIContext.hpp b/src/shared/CLIContext.hpp
new file mode 100644 (file)
index 0000000..8de432b
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef BLANK_SHARED_CLICONTEXT_HPP_
+#define BLANK_SHARED_CLICONTEXT_HPP_
+
+#include <string>
+
+
+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