]> git.localhorst.tv Git - blank.git/blobdiff - src/app/Runtime.hpp
first draft for client/server architecture
[blank.git] / src / app / Runtime.hpp
index 81c015c3668456360b1c84dc77587ba026848b1a..ee438537a345ef43e0f884f24ca799588b15ba4a 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef BLANK_RUNTIME_HPP_
 #define BLANK_RUNTIME_HPP_
 
+#include "../net/Client.hpp"
+#include "../net/Server.hpp"
 #include "../ui/Interface.hpp"
 #include "../world/World.hpp"
 
@@ -10,6 +12,8 @@
 
 namespace blank {
 
+class HeadlessApplication;
+
 /// Parse and interpret arguemnts, then set up the environment and execute.
 class Runtime {
 
@@ -27,6 +31,12 @@ public:
                ERROR,
        };
 
+       enum Target {
+               STANDALONE,
+               SERVER,
+               CLIENT,
+       };
+
        struct Config {
                bool vsync = true;
                bool doublebuf = true;
@@ -36,7 +46,9 @@ public:
                std::string save_path;
                std::string world_name = "default";
 
+               Client::Config client = Client::Config();
                Interface::Config interface = Interface::Config();
+               Server::Config server = Server::Config();
                World::Config world = World::Config();
        };
 
@@ -46,9 +58,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;