]> git.localhorst.tv Git - blank.git/blob - src/standalone/MasterState.hpp
block sounds depending on block type
[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 "../audio/SoundBank.hpp"
11 #include "../graphics/SkyBox.hpp"
12 #include "../shared/WorldResources.hpp"
13 #include "../ui/DirectInput.hpp"
14 #include "../ui/HUD.hpp"
15 #include "../ui/InteractiveManipulator.hpp"
16 #include "../ui/Interface.hpp"
17 #include "../world/ChunkIndex.hpp"
18 #include "../world/ChunkLoader.hpp"
19 #include "../world/ChunkRenderer.hpp"
20 #include "../world/Generator.hpp"
21 #include "../world/Player.hpp"
22 #include "../world/World.hpp"
23
24
25 namespace blank {
26
27 class Config;
28 class Environment;
29
30 namespace standalone {
31
32 class MasterState
33 : public State
34 , public ClientController {
35
36 public:
37         MasterState(
38                 Environment &,
39                 Config &,
40                 const Generator::Config &,
41                 const World::Config &,
42                 const WorldSave &
43         );
44         ~MasterState();
45
46         void OnResume() override;
47         void OnPause() override;
48
49         void Handle(const SDL_Event &) override;
50         void Update(int dt) override;
51         void Render(Viewport &) override;
52
53         World &GetWorld() noexcept { return world; }
54         Interface &GetInterface() noexcept { return interface; }
55
56         void SetAudio(bool) override;
57         void SetVideo(bool) override;
58         void SetHUD(bool) override;
59         void SetDebug(bool) override;
60         void Exit() override;
61
62 private:
63         Config &config;
64         Environment &env;
65         WorldResources res;
66         SoundBank sounds;
67         const WorldSave &save;
68         World world;
69         ChunkIndex &spawn_index;
70         Player &player;
71         bool spawn_player;
72         HUD hud;
73         InteractiveManipulator manip;
74         DirectInput input;
75         Interface interface;
76         Generator generator;
77         ChunkLoader chunk_loader;
78         ChunkRenderer chunk_renderer;
79         Spawner spawner;
80
81         SkyBox sky;
82
83         PreloadState preload;
84         UnloadState unload;
85
86 };
87
88 }
89 }
90
91 #endif