+void Runtime::RunServer() {
+ HeadlessEnvironment env(config.env);
+
+ WorldSave save(config.env.GetWorldPath(config.world.name));
+ if (save.Exists()) {
+ save.Read(config.world);
+ save.Read(config.gen);
+ } else {
+ save.Write(config.world);
+ save.Write(config.gen);
+ }
+
+ HeadlessApplication app(env);
+ server::ServerState server_state(env, config.gen, config.world, save, config.server);
+ app.PushState(&server_state);
+ Run(app);
+}
+
+void Runtime::RunClient() {
+ Init init(config.doublebuf, config.multisampling);
+
+ Environment env(init.window, config.env);
+ env.viewport.VSync(config.vsync);
+
+ Application app(env);
+ client::MasterState client_state(env, config.world, config.interface, config.client);
+ app.PushState(&client_state);
+ Run(app);
+}
+
+void Runtime::Run(HeadlessApplication &app) {