]> git.localhorst.tv Git - blank.git/blob - src/app/WorldState.hpp
c0b4ce10a23829f8012d9a4c144d3d2e2a971ba4
[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/ChunkRenderer.hpp"
12 #include "../world/World.hpp"
13
14
15 namespace blank {
16
17 class Environment;
18
19 class WorldState
20 : public State {
21
22 public:
23         WorldState(
24                 Environment &,
25                 const Interface::Config &,
26                 const World::Config &,
27                 const WorldSave &
28         );
29
30         void OnEnter() override;
31
32         void Handle(const SDL_Event &) override;
33         void Update(int dt) override;
34         void Render(Viewport &) override;
35
36         World &GetWorld() noexcept { return world; }
37         Interface &GetInterface() noexcept { return interface; }
38
39 private:
40         Environment &env;
41         BlockTypeRegistry block_types;
42         World world;
43         ChunkRenderer chunk_renderer;
44         Skeletons skeletons;
45         Spawner spawner;
46         Interface interface;
47
48         PreloadState preload;
49         UnloadState unload;
50
51 };
52
53 }
54
55 #endif