]> git.localhorst.tv Git - blank.git/blobdiff - src/app/Runtime.hpp
unified location handling
[blank.git] / src / app / Runtime.hpp
index 036b8dbfc635ef9078454036113626b2b79266b0..1e660e0ac9465903bb475410fb542303425f4b00 100644 (file)
@@ -1,14 +1,21 @@
 #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>
+#include <string>
 
 
 namespace blank {
 
+class HeadlessApplication;
+
 /// Parse and interpret arguemnts, then set up the environment and execute.
 class Runtime {
 
@@ -26,24 +33,39 @@ public:
                ERROR,
        };
 
-       struct Config {
-               bool vsync = true;
-               bool doublebuf = true;
-               int multisampling = 1;
+       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();
        };
 
        Runtime() noexcept;
 
-       void ReadArgs(int argc, const char *const *argv);
+       void Initialize(int argc, const char *const *argv);
 
        int Execute();
 
+private:
+       void ReadArgs(int argc, const char *const *argv);
+       void ReadPreferences();
+
+       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;