X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FWorldState.hpp;h=d47024ff6633ed1fb65cb07dd29d1c8ba6ce2080;hb=ad7cf72ed47c39640d5588ba53386e090289b4d1;hp=38922ff59c43f2e5dbaa59803ec42ca2fbe339f8;hpb=afd253b2dd10fdf2d4655d3d4a5766e6aa8c1a2c;p=blank.git diff --git a/src/app/WorldState.hpp b/src/app/WorldState.hpp index 38922ff..d47024f 100644 --- a/src/app/WorldState.hpp +++ b/src/app/WorldState.hpp @@ -1,9 +1,13 @@ #ifndef BLANK_APP_WORLDSTATE_HPP_ #define BLANK_APP_WORLDSTATE_HPP_ +#include "PreloadState.hpp" #include "State.hpp" +#include "UnloadState.hpp" #include "../ai/Spawner.hpp" #include "../ui/Interface.hpp" +#include "../world/BlockTypeRegistry.hpp" +#include "../world/ChunkRenderer.hpp" #include "../world/World.hpp" @@ -18,19 +22,30 @@ public: WorldState( Environment &, const Interface::Config &, - const World::Config & + const World::Config &, + const WorldSave & ); + void OnEnter() override; + void Handle(const SDL_Event &) override; void Update(int dt) override; void Render(Viewport &) override; + World &GetWorld() noexcept { return world; } + Interface &GetInterface() noexcept { return interface; } + private: Environment &env; + BlockTypeRegistry block_types; World world; + ChunkRenderer chunk_renderer; Spawner spawner; Interface interface; + PreloadState preload; + UnloadState unload; + }; }