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
@@ -23,18 +23,18 @@ LevelFrontend::LevelFrontend(
controller(controller),
assets(assets),
contentCache(std::make_unique<ContentGfxCache>(
*level.content, assets, settings.graphics
level.content, assets, settings.graphics
)) {
assets.store(
BlocksPreview::build(
*contentCache, assets, *level.content->getIndices()
*contentCache, assets, *level.content.getIndices()
),
"block-previews"
);
controller->getBlocksController()->listenBlockInteraction(
[currentPlayer, controller, &assets](auto player, const auto& pos, const auto& def, BlockInteraction type) {
const auto& level = *controller->getLevel();
auto material = level.content->findBlockMaterial(def.material);
auto material = level.content.findBlockMaterial(def.material);
if (material == nullptr) {
return;
}