]> git.localhorst.tv Git - blank.git/blobdiff - src/app/Runtime.hpp
split input handling
[blank.git] / src / app / Runtime.hpp
index 81c015c3668456360b1c84dc77587ba026848b1a..2d169d0149abbcddf69ee8321f121484f783b7f5 100644 (file)
@@ -1,7 +1,11 @@
 #ifndef BLANK_RUNTIME_HPP_
 #define BLANK_RUNTIME_HPP_
 
+#include "Environment.hpp"
+#include "../client/Client.hpp"
+#include "../server/Server.hpp"
 #include "../ui/Interface.hpp"
+#include "../world/Generator.hpp"
 #include "../world/World.hpp"
 
 #include <cstddef>
@@ -10,6 +14,8 @@
 
 namespace blank {
 
+class HeadlessApplication;
+
 /// Parse and interpret arguemnts, then set up the environment and execute.
 class Runtime {
 
@@ -27,16 +33,16 @@ public:
                ERROR,
        };
 
-       struct Config {
-               bool vsync = true;
-               bool doublebuf = true;
-               int multisampling = 1;
-
-               std::string asset_path;
-               std::string save_path;
-               std::string world_name = "default";
+       enum Target {
+               STANDALONE,
+               SERVER,
+               CLIENT,
+       };
 
-               Interface::Config interface = Interface::Config();
+       struct Config {
+               blank::Config game = blank::Config();
+               HeadlessEnvironment::Config env = HeadlessEnvironment::Config();
+               Generator::Config gen = Generator::Config();
                World::Config world = World::Config();
        };
 
@@ -46,9 +52,17 @@ public:
 
        int Execute();
 
+private:
+       void RunStandalone();
+       void RunServer();
+       void RunClient();
+
+       void Run(HeadlessApplication &);
+
 private:
        const char *name;
        Mode mode;
+       Target target;
        std::size_t n;
        std::size_t t;
        Config config;