]> git.localhorst.tv Git - blank.git/blobdiff - src/app/runtime.cpp
move standalone stuff to its own dir
[blank.git] / src / app / runtime.cpp
index e169a7bb5eb1d73efd4efa997ddc4f902c119ca9..486259a45cb0d89eb25d265ed8a9becf0d7b0c2b 100644 (file)
@@ -1,13 +1,13 @@
 #include "Application.hpp"
 #include "Environment.hpp"
 #include "Runtime.hpp"
-#include "ServerState.hpp"
-#include "WorldState.hpp"
 
 #include "init.hpp"
 #include "../client/MasterState.hpp"
 #include "../io/filesystem.hpp"
 #include "../io/WorldSave.hpp"
+#include "../server/ServerState.hpp"
+#include "../standalone/MasterState.hpp"
 
 #include <cctype>
 #include <cstdlib>
@@ -220,7 +220,7 @@ void Runtime::ReadArgs(int argc, const char *const *argv) {
                                                                cerr << "missing argument to -s" << endl;
                                                                error = true;
                                                        } else {
-                                                               config.world.gen.seed = strtoul(argv[i], nullptr, 10);
+                                                               config.gen.seed = strtoul(argv[i], nullptr, 10);
                                                        }
                                                        break;
                                                case 't':
@@ -317,12 +317,14 @@ void Runtime::RunStandalone() {
        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);
        }
 
        Application app(env);
-       WorldState world_state(env, config.interface, config.world, save);
+       standalone::MasterState world_state(env, config.gen, config.interface, config.world, save);
        app.PushState(&world_state);
        Run(app);
 }
@@ -333,12 +335,14 @@ void Runtime::RunServer() {
        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);
-       ServerState server_state(env, config.world, save, config.server);
+       server::ServerState server_state(env, config.gen, config.world, save, config.server);
        app.PushState(&server_state);
        Run(app);
 }