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

View file

@ -26,15 +26,15 @@ class GlobalChunks {
return ekey.key;
}
Level* level;
const ContentIndices* indices;
Level& level;
const ContentIndices& indices;
std::unordered_map<uint64_t, std::shared_ptr<Chunk>> chunksMap;
std::unordered_map<glm::ivec2, std::shared_ptr<Chunk>> pinnedChunks;
std::unordered_map<ptrdiff_t, int> refCounters;
consumer<Chunk&> onUnload;
public:
GlobalChunks(Level* level);
GlobalChunks(Level& level);
~GlobalChunks() = default;
void setOnUnload(consumer<Chunk&> onUnload);
@ -68,6 +68,6 @@ public:
}
const ContentIndices& getContentIndices() const {
return *indices;
return indices;
}
};