refactor: change pointer parameters to references for Level and Content in various classes

This commit is contained in:
MihailRis
2024-12-25 18:53:53 +03:00
parent ef2c0b2370
commit c1b311f3c4
41 changed files with 258 additions and 251 deletions
+3 -3
View File
@@ -152,7 +152,7 @@ static void load_world(
auto& packs = engine.getContentPacks();
auto& settings = engine.getSettings();
auto level = World::load(worldFiles, settings, content, packs);
auto level = World::load(worldFiles, settings, *content, packs);
engine.onWorldOpen(std::move(level));
} catch (const world_load_error& error) {
guiutil::alert(
@@ -164,7 +164,7 @@ static void load_world(
}
void EngineController::openWorld(const std::string& name, bool confirmConvert) {
auto& paths = engine.getPaths();
const auto& paths = engine.getPaths();
auto folder = paths.getWorldsFolder() / fs::u8path(name);
auto worldFile = folder / fs::u8path("world.json");
if (!fs::exists(worldFile)) {
@@ -245,7 +245,7 @@ void EngineController::createWorld(
folder,
seed,
engine.getSettings(),
engine.getContent(),
*engine.getContent(),
engine.getContentPacks()
);
if (!engine.isHeadless()) {