]> git.localhorst.tv Git - blank.git/blob - src/standalone/MasterState.hpp
split input handling
[blank.git] / src / standalone / MasterState.hpp
1 #ifndef BLANK_STANDALONE_MASTERSTATE_HPP_
2 #define BLANK_STANDALONE_MASTERSTATE_HPP_
3
4 #include "../app/State.hpp"
5 #include "../ui/ClientController.hpp"
6
7 #include "PreloadState.hpp"
8 #include "UnloadState.hpp"
9 #include "../ai/Spawner.hpp"
10 #include "../graphics/SkyBox.hpp"
11 #include "../model/Skeletons.hpp"
12 #include "../ui/DirectInput.hpp"
13 #include "../ui/HUD.hpp"
14 #include "../ui/InteractiveManipulator.hpp"
15 #include "../ui/Interface.hpp"
16 #include "../world/BlockTypeRegistry.hpp"
17 #include "../world/ChunkLoader.hpp"
18 #include "../world/ChunkRenderer.hpp"
19 #include "../world/Generator.hpp"
20 #include "../world/Player.hpp"
21 #include "../world/World.hpp"
22
23
24 namespace blank {
25
26 class Config;
27 class Environment;
28
29 namespace standalone {
30
31 class MasterState
32 : public State
33 , public ClientController {
34
35 public:
36         MasterState(
37                 Environment &,
38                 Config &,
39                 const Generator::Config &,
40                 const World::Config &,
41                 const WorldSave &
42         );
43
44         void OnEnter() override;
45
46         void Handle(const SDL_Event &) override;
47         void Update(int dt) override;
48         void Render(Viewport &) override;
49
50         World &GetWorld() noexcept { return world; }
51         Interface &GetInterface() noexcept { return interface; }
52
53         void SetAudio(bool) override;
54         void SetVideo(bool) override;
55         void SetHUD(bool) override;
56         void SetDebug(bool) override;
57         void Exit() override;
58
59 private:
60         Config &config;
61         Environment &env;
62         BlockTypeRegistry block_types;
63         World world;
64         Player &player;
65         HUD hud;
66         InteractiveManipulator manip;
67         DirectInput input;
68         Interface interface;
69         Generator generator;
70         ChunkLoader chunk_loader;
71         ChunkRenderer chunk_renderer;
72         Skeletons skeletons;
73         Spawner spawner;
74
75         SkyBox sky;
76
77         PreloadState preload;
78         UnloadState unload;
79
80 };
81
82 }
83 }
84
85 #endif