]> git.localhorst.tv Git - blank.git/blobdiff - src/app/Environment.hpp
merge common parts of pre- and unload states
[blank.git] / src / app / Environment.hpp
index b465bfb48f19c88e7e157e68b3f5c9f2e10ca66d..724db7072de75fa0aa3904ebd1f2c1332aa70ab9 100644 (file)
@@ -3,28 +3,66 @@
 
 #include "Assets.hpp"
 #include "FrameCounter.hpp"
+#include "MessageState.hpp"
 #include "StateControl.hpp"
 #include "../audio/Audio.hpp"
 #include "../graphics/Viewport.hpp"
+#include "../rand/GaloisLFSR.hpp"
+#include "../ui/Keymap.hpp"
+
+#include <string>
 
 
 namespace blank {
 
 class Window;
 
-struct Environment {
+struct HeadlessEnvironment {
+
+       struct Config {
+               std::string asset_path;
+               std::string save_path;
+
+               std::string GetWorldPath(
+                       const std::string &world_name
+               ) const;
+               std::string GetWorldPath(
+                       const std::string &world_name,
+                       const std::string &hostname
+               ) const;
+       } config;
+
+       AssetLoader loader;
+
+       FrameCounter counter;
+
+       StateControl state;
+
+       GaloisLFSR rng;
+
+
+       explicit HeadlessEnvironment(const Config &);
+
+};
+
+
+struct Environment
+: public HeadlessEnvironment {
+
+       Assets assets;
 
        Audio audio;
        Viewport viewport;
        Window &window;
 
-       Assets assets;
-       FrameCounter counter;
+       Keymap keymap;
+
+       MessageState msg_state;
 
-       StateControl state;
 
+       Environment(Window &win, const Config &);
 
-       explicit Environment(Window &win);
+       void ShowMessage(const char *);
 
 };