]> git.localhorst.tv Git - blank.git/blob - src/shared/ChatState.hpp
7b8a993c6fa0fa782cc6a80387a9b5f7872b75aa
[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 OnResume() override;
27         void OnPause() override;
28
29         void OnResize(Viewport &) override;
30
31         void Handle(const SDL_Event &) override;
32         void Update(int dt) override;
33         void Render(Viewport &) override;
34
35         void Quit();
36
37 private:
38         Environment &env;
39         State &parent;
40         Responder &responder;
41
42         TextInput input;
43
44 };
45
46 }
47
48 #endif