]> git.localhorst.tv Git - blank.git/blobdiff - src/standalone/MasterState.hpp
better handling of focus and input
[blank.git] / src / standalone / MasterState.hpp
index ca5cab29879ebdaf6c9a7cd73ec895736213666a..942cc132e94a585bd6bcc066245f738daefe5cf3 100644 (file)
@@ -2,39 +2,54 @@
 #define BLANK_STANDALONE_MASTERSTATE_HPP_
 
 #include "../app/State.hpp"
+#include "../ui/ClientController.hpp"
 
 #include "PreloadState.hpp"
 #include "UnloadState.hpp"
 #include "../ai/Spawner.hpp"
+#include "../app/ChatState.hpp"
+#include "../audio/SoundBank.hpp"
 #include "../graphics/SkyBox.hpp"
-#include "../model/Skeletons.hpp"
+#include "../shared/WorldResources.hpp"
+#include "../ui/DirectInput.hpp"
+#include "../ui/HUD.hpp"
+#include "../ui/InteractiveManipulator.hpp"
 #include "../ui/Interface.hpp"
-#include "../world/BlockTypeRegistry.hpp"
+#include "../world/ChunkIndex.hpp"
 #include "../world/ChunkLoader.hpp"
 #include "../world/ChunkRenderer.hpp"
 #include "../world/Generator.hpp"
+#include "../world/Player.hpp"
 #include "../world/World.hpp"
 
 
 namespace blank {
 
+class Config;
 class Environment;
 
 namespace standalone {
 
 class MasterState
-: public State {
+: public State
+, public ClientController
+, public ChatState::Responder {
 
 public:
        MasterState(
                Environment &,
+               Config &,
                const Generator::Config &,
-               const Interface::Config &,
                const World::Config &,
                const WorldSave &
        );
+       ~MasterState();
 
-       void OnEnter() override;
+       void OnResume() override;
+       void OnPause() override;
+
+       void OnFocus() override;
+       void OnBlur() override;
 
        void Handle(const SDL_Event &) override;
        void Update(int dt) override;
@@ -43,21 +58,38 @@ public:
        World &GetWorld() noexcept { return world; }
        Interface &GetInterface() noexcept { return interface; }
 
+       void SetAudio(bool) override;
+       void SetVideo(bool) override;
+       void SetHUD(bool) override;
+       void SetDebug(bool) override;
+       void Exit() override;
+
+       void OnLineSubmit(const std::string &) override;
+
 private:
+       Config &config;
        Environment &env;
-       BlockTypeRegistry block_types;
+       WorldResources res;
+       SoundBank sounds;
+       const WorldSave &save;
        World world;
+       ChunkIndex &spawn_index;
+       Player &player;
+       bool spawn_player;
+       HUD hud;
+       InteractiveManipulator manip;
+       DirectInput input;
        Interface interface;
        Generator generator;
        ChunkLoader chunk_loader;
        ChunkRenderer chunk_renderer;
-       Skeletons skeletons;
        Spawner spawner;
 
        SkyBox sky;
 
        PreloadState preload;
        UnloadState unload;
+       ChatState chat;
 
 };