]> git.localhorst.tv Git - blank.git/blobdiff - src/app/Runtime.hpp
reorganized client state
[blank.git] / src / app / Runtime.hpp
index ac508b90677bf8fbe5d19e44c7111bc2c55456a5..10a0e55cb559365366c29c090c2dc29bfb67778f 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef BLANK_RUNTIME_HPP_
 #define BLANK_RUNTIME_HPP_
 
+#include "Environment.hpp"
+#include "../net/Client.hpp"
+#include "../net/Server.hpp"
 #include "../ui/Interface.hpp"
 #include "../world/World.hpp"
 
@@ -10,6 +13,8 @@
 
 namespace blank {
 
+class HeadlessApplication;
+
 /// Parse and interpret arguemnts, then set up the environment and execute.
 class Runtime {
 
@@ -27,15 +32,21 @@ public:
                ERROR,
        };
 
+       enum Target {
+               STANDALONE,
+               SERVER,
+               CLIENT,
+       };
+
        struct Config {
                bool vsync = true;
                bool doublebuf = true;
                int multisampling = 1;
 
-               std::string asset_path;
-               std::string save_path;
-
+               Client::Config client = Client::Config();
+               HeadlessEnvironment::Config env = HeadlessEnvironment::Config();
                Interface::Config interface = Interface::Config();
+               Server::Config server = Server::Config();
                World::Config world = World::Config();
        };
 
@@ -45,9 +56,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;