]> git.localhorst.tv Git - blank.git/blob - src/standalone/MasterState.hpp
move standalone stuff to its own dir
[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
6 #include "PreloadState.hpp"
7 #include "UnloadState.hpp"
8 #include "../ai/Spawner.hpp"
9 #include "../graphics/SkyBox.hpp"
10 #include "../model/Skeletons.hpp"
11 #include "../ui/Interface.hpp"
12 #include "../world/BlockTypeRegistry.hpp"
13 #include "../world/ChunkLoader.hpp"
14 #include "../world/ChunkRenderer.hpp"
15 #include "../world/Generator.hpp"
16 #include "../world/World.hpp"
17
18
19 namespace blank {
20
21 class Environment;
22
23 namespace standalone {
24
25 class MasterState
26 : public State {
27
28 public:
29         MasterState(
30                 Environment &,
31                 const Generator::Config &,
32                 const Interface::Config &,
33                 const World::Config &,
34                 const WorldSave &
35         );
36
37         void OnEnter() override;
38
39         void Handle(const SDL_Event &) override;
40         void Update(int dt) override;
41         void Render(Viewport &) override;
42
43         World &GetWorld() noexcept { return world; }
44         Interface &GetInterface() noexcept { return interface; }
45
46 private:
47         Environment &env;
48         BlockTypeRegistry block_types;
49         World world;
50         Interface interface;
51         Generator generator;
52         ChunkLoader chunk_loader;
53         ChunkRenderer chunk_renderer;
54         Skeletons skeletons;
55         Spawner spawner;
56
57         SkyBox sky;
58
59         PreloadState preload;
60         UnloadState unload;
61
62 };
63
64 }
65 }
66
67 #endif