]> git.localhorst.tv Git - blank.git/blob - src/standalone/MasterState.hpp
6e630200fa9eab8e60b653e7fb5bf76cae1b9d53
[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 "../shared/WorldResources.hpp"
12 #include "../ui/DirectInput.hpp"
13 #include "../ui/HUD.hpp"
14 #include "../ui/InteractiveManipulator.hpp"
15 #include "../ui/Interface.hpp"
16 #include "../world/ChunkIndex.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         ~MasterState();
44
45         void OnResume() override;
46         void OnPause() override;
47
48         void Handle(const SDL_Event &) override;
49         void Update(int dt) override;
50         void Render(Viewport &) override;
51
52         World &GetWorld() noexcept { return world; }
53         Interface &GetInterface() noexcept { return interface; }
54
55         void SetAudio(bool) override;
56         void SetVideo(bool) override;
57         void SetHUD(bool) override;
58         void SetDebug(bool) override;
59         void Exit() override;
60
61 private:
62         Config &config;
63         Environment &env;
64         WorldResources res;
65         const WorldSave &save;
66         World world;
67         ChunkIndex &spawn_index;
68         Player &player;
69         bool spawn_player;
70         HUD hud;
71         InteractiveManipulator manip;
72         DirectInput input;
73         Interface interface;
74         Generator generator;
75         ChunkLoader chunk_loader;
76         ChunkRenderer chunk_renderer;
77         Spawner spawner;
78
79         SkyBox sky;
80
81         PreloadState preload;
82         UnloadState unload;
83
84 };
85
86 }
87 }
88
89 #endif