]> git.localhorst.tv Git - blank.git/blobdiff - src/app/Environment.hpp
moved common stated to shared dir
[blank.git] / src / app / Environment.hpp
index 4c935d815e2f4a13483452e791a203dcfce31db7..7061000fa221ffe1f3da97ad7e42ff43d4a08fcf 100644 (file)
@@ -6,6 +6,8 @@
 #include "StateControl.hpp"
 #include "../audio/Audio.hpp"
 #include "../graphics/Viewport.hpp"
+#include "../rand/GaloisLFSR.hpp"
+#include "../shared/MessageState.hpp"
 #include "../ui/Keymap.hpp"
 
 #include <string>
@@ -15,20 +17,52 @@ 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;
        Keymap keymap;
-       FrameCounter counter;
 
-       StateControl state;
+       MessageState msg_state;
+
 
+       Environment(Window &win, const Config &);
 
-       explicit Environment(Window &win, const std::string &asset_path);
+       void ShowMessage(const char *);
 
 };