]> git.localhorst.tv Git - blank.git/blob - src/client/InteractiveState.hpp
65c92d08ff33ab905421201621c575a1ce333250
[blank.git] / src / client / InteractiveState.hpp
1 #ifndef BLANK_CLIENT_INTERACTIVESTATE_HPP_
2 #define BLANK_CLIENT_INTERACTIVESTATE_HPP_
3
4 #include "../app/State.hpp"
5 #include "../io/WorldSave.hpp"
6 #include "../ui/Interface.hpp"
7 #include "../world/BlockTypeRegistry.hpp"
8 #include "../world/ChunkRenderer.hpp"
9 #include "../world/World.hpp"
10
11
12 namespace blank {
13
14 class Environment;
15
16 namespace client {
17
18 class MasterState;
19
20 class InteractiveState
21 : public State {
22
23 public:
24         explicit InteractiveState(MasterState &, std::uint32_t player_id);
25
26         World &GetWorld() noexcept { return world; }
27         Interface &GetInterface() noexcept { return interface; }
28
29         void OnEnter() override;
30
31         void Handle(const SDL_Event &) override;
32         void Update(int dt) override;
33         void Render(Viewport &) override;
34
35 private:
36         MasterState &master;
37         BlockTypeRegistry block_types;
38         WorldSave save;
39         World world;
40         ChunkRenderer chunk_renderer;
41         Interface interface;
42
43 };
44
45 }
46 }
47
48 #endif