X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FRuntime.hpp;h=65ad408d4ffffd7c1a826142f2a5a6b8734e95f5;hb=ac41db13c9d64f5ef12b26c335d57504d02fd2fd;hp=81c015c3668456360b1c84dc77587ba026848b1a;hpb=39df551265bff648c1ac166043bb4b046122cc8d;p=blank.git diff --git a/src/app/Runtime.hpp b/src/app/Runtime.hpp index 81c015c..65ad408 100644 --- a/src/app/Runtime.hpp +++ b/src/app/Runtime.hpp @@ -1,7 +1,11 @@ #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/Generator.hpp" #include "../world/World.hpp" #include @@ -10,6 +14,8 @@ namespace blank { +class HeadlessApplication; + /// Parse and interpret arguemnts, then set up the environment and execute. class Runtime { @@ -27,16 +33,22 @@ 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; - std::string world_name = "default"; - + Client::Config client = Client::Config(); + Generator::Config gen = Generator::Config(); + HeadlessEnvironment::Config env = HeadlessEnvironment::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;