]> git.localhorst.tv Git - blank.git/blob - src/app/WorldState.hpp
more packet introspection from payload
[blank.git] / src / app / WorldState.hpp
1 #ifndef BLANK_APP_WORLDSTATE_HPP_
2 #define BLANK_APP_WORLDSTATE_HPP_
3
4 #include "PreloadState.hpp"
5 #include "State.hpp"
6 #include "UnloadState.hpp"
7 #include "../ai/Spawner.hpp"
8 #include "../model/Skeletons.hpp"
9 #include "../ui/Interface.hpp"
10 #include "../world/BlockTypeRegistry.hpp"
11 #include "../world/ChunkLoader.hpp"
12 #include "../world/ChunkRenderer.hpp"
13 #include "../world/Generator.hpp"
14 #include "../world/World.hpp"
15
16
17 namespace blank {
18
19 class Environment;
20
21 class WorldState
22 : public State {
23
24 public:
25         WorldState(
26                 Environment &,
27                 const Generator::Config &,
28                 const Interface::Config &,
29                 const World::Config &,
30                 const WorldSave &
31         );
32
33         void OnEnter() override;
34
35         void Handle(const SDL_Event &) override;
36         void Update(int dt) override;
37         void Render(Viewport &) override;
38
39         World &GetWorld() noexcept { return world; }
40         Interface &GetInterface() noexcept { return interface; }
41
42 private:
43         Environment &env;
44         BlockTypeRegistry block_types;
45         World world;
46         Interface interface;
47         Generator generator;
48         ChunkLoader chunk_loader;
49         ChunkRenderer chunk_renderer;
50         Skeletons skeletons;
51         Spawner spawner;
52
53         PreloadState preload;
54         UnloadState unload;
55
56 };
57
58 }
59
60 #endif