EngineController draft
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
|
||||
#include "../../../engine.h"
|
||||
#include "../../../files/engine_paths.h"
|
||||
#include "../../../frontend/menu/menu.h"
|
||||
#include "../../../frontend/menu/menu.hpp"
|
||||
#include "../../../frontend/screens.h"
|
||||
#include "../../../logic/LevelController.h"
|
||||
#include "../../../logic/EngineController.hpp"
|
||||
#include "../../../window/Events.h"
|
||||
#include "../../../window/Window.h"
|
||||
#include "../../../world/WorldGenerators.h"
|
||||
@@ -34,14 +35,16 @@ static int l_new_world(lua_State* L) {
|
||||
auto name = lua_tostring(L, 1);
|
||||
auto seed = lua_tostring(L, 2);
|
||||
auto generator = lua_tostring(L, 3);
|
||||
menus::create_world(scripting::engine, name, seed, generator);
|
||||
auto controller = scripting::engine->getController();
|
||||
controller->createWorld(name, seed, generator);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_open_world(lua_State* L) {
|
||||
auto name = lua_tostring(L, 1);
|
||||
scripting::engine->setScreen(nullptr);
|
||||
menus::open_world(name, scripting::engine, false);
|
||||
|
||||
auto controller = scripting::engine->getController();
|
||||
controller->openWorld(name, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -62,7 +65,8 @@ static int l_close_world(lua_State* L) {
|
||||
|
||||
static int l_delete_world(lua_State* L) {
|
||||
auto name = lua_tostring(L, 1);
|
||||
menus::delete_world(name, scripting::engine);
|
||||
auto controller = scripting::engine->getController();
|
||||
controller->deleteWorld(name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -77,7 +81,8 @@ static int l_remove_packs(lua_State* L) {
|
||||
packs.push_back(lua_tostring(L, -1));
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
menus::remove_packs(scripting::engine, scripting::controller, packs);
|
||||
auto controller = scripting::engine->getController();
|
||||
controller->removePacks(scripting::controller, packs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -92,7 +97,8 @@ static int l_add_packs(lua_State* L) {
|
||||
packs.push_back(lua_tostring(L, -1));
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
menus::add_packs(scripting::engine, scripting::controller, packs);
|
||||
auto controller = scripting::engine->getController();
|
||||
controller->addPacks(scripting::controller, packs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user