X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FRuntime.hpp;h=1e660e0ac9465903bb475410fb542303425f4b00;hb=6513b55584093a86ce1e369e054263dd75c295c8;hp=ac508b90677bf8fbe5d19e44c7111bc2c55456a5;hpb=34a7fafb4c2d4ed95eb990eda5c02d5c79d3411b;p=blank.git diff --git a/src/app/Runtime.hpp b/src/app/Runtime.hpp index ac508b9..1e660e0 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 "../client/Client.hpp" +#include "../server/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,27 +33,39 @@ public: ERROR, }; - struct Config { - bool vsync = true; - bool doublebuf = true; - int multisampling = 1; - - std::string asset_path; - std::string save_path; + 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;