]> git.localhorst.tv Git - blank.git/blob - src/standalone/MasterState.hpp
823e7f3a67ed781f1c274e5f598c004839bb8966
[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         const WorldSave &save;
64         World world;
65         Player &player;
66         HUD hud;
67         InteractiveManipulator manip;
68         DirectInput input;
69         Interface interface;
70         Generator generator;
71         ChunkLoader chunk_loader;
72         ChunkRenderer chunk_renderer;
73         Skeletons skeletons;
74         Spawner spawner;
75
76         SkyBox sky;
77
78         PreloadState preload;
79         UnloadState unload;
80
81 };
82
83 }
84 }
85
86 #endif