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