]> git.localhorst.tv Git - blank.git/blob - src/shared/ChatState.hpp
test for invoking with unknown argument
[blank.git] / src / shared / ChatState.hpp
1 #ifndef BLANK_SHARED_CHATSTATE_HPP_
2 #define BLANK_SHARED_CHATSTATE_HPP_
3
4 #include "../app/State.hpp"
5
6 #include "../ui/TextInput.hpp"
7
8 #include <string>
9
10
11 namespace blank {
12
13 class Environment;
14
15 class ChatState
16 : public State {
17
18 public:
19         struct Responder {
20                 virtual void OnLineSubmit(const std::string &) = 0;
21         };
22
23 public:
24         ChatState(Environment &env, State &parent, Responder &);
25
26         void Preset(const std::string &);
27         void Clear();
28
29         void OnResume() override;
30         void OnPause() override;
31
32         void OnResize(Viewport &) override;
33
34         void Handle(const SDL_Event &) override;
35         void Update(int dt) override;
36         void Render(Viewport &) override;
37
38         void Quit();
39
40 private:
41         Environment &env;
42         State &parent;
43         Responder &responder;
44
45         std::string preset;
46         TextInput input;
47
48 };
49
50 }
51
52 #endif