mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
feat: add app.save_world() function and update documentation
This commit is contained in:
parent
96577ee041
commit
ed7dc1f901
8 changed files with 48 additions and 7 deletions
|
|
@ -8,6 +8,7 @@
|
|||
#include <glm/gtx/hash.hpp>
|
||||
|
||||
#include "voxel.hpp"
|
||||
#include "delegates.hpp"
|
||||
|
||||
class Chunk;
|
||||
class Level;
|
||||
|
|
@ -30,10 +31,14 @@ class GlobalChunks {
|
|||
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() = default;
|
||||
|
||||
void setOnUnload(consumer<Chunk&> onUnload);
|
||||
|
||||
std::shared_ptr<Chunk> fetch(int x, int z);
|
||||
std::shared_ptr<Chunk> create(int x, int z);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue