]> git.localhorst.tv Git - blank.git/blobdiff - src/app/Runtime.hpp
group entity updates in as few packets as possible
[blank.git] / src / app / Runtime.hpp
index ee0b4a023737ef1f4d6fea40d7723ab621e10667..36808a0e2a0e385cbcc9b2bd013e4310abdba1ef 100644 (file)
@@ -1,13 +1,21 @@
 #ifndef BLANK_RUNTIME_HPP_
 #define BLANK_RUNTIME_HPP_
 
-#include "Application.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 {
 
@@ -25,18 +33,45 @@ public:
                ERROR,
        };
 
+       enum Target {
+               STANDALONE,
+               SERVER,
+               CLIENT,
+       };
+
+       struct Config {
+               bool vsync = true;
+               bool doublebuf = true;
+               int multisampling = 1;
+
+               client::Client::Config client = client::Client::Config();
+               Generator::Config gen = Generator::Config();
+               HeadlessEnvironment::Config env = HeadlessEnvironment::Config();
+               Interface::Config interface = Interface::Config();
+               server::Server::Config server = server::Server::Config();
+               World::Config world = World::Config();
+       };
+
        Runtime() noexcept;
 
        void ReadArgs(int argc, const char *const *argv);
 
        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;
-       Application::Config config;
+       Config config;
 
 };