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