mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
refactor: change pointer parameters to references for Level and Content in various classes
This commit is contained in:
parent
ef2c0b2370
commit
c1b311f3c4
41 changed files with 258 additions and 251 deletions
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue