feat: saving entities (WIP)

This commit is contained in:
MihailRis
2024-07-05 05:16:31 +03:00
parent 019a88ef84
commit f0270d3391
24 changed files with 290 additions and 101 deletions
+6 -3
View File
@@ -18,9 +18,11 @@ class Chunk;
class WorldFiles;
class LevelEvents;
class Block;
class Level;
/* Player-centred chunks matrix */
/// Player-centred chunks matrix
class Chunks {
Level* level;
const ContentIndices* const indices;
void eraseSegments(const Block* def, blockstate state, int x, int y, int z);
@@ -35,10 +37,9 @@ public:
uint32_t w, d;
int32_t ox, oz;
WorldFiles* worldFiles;
LevelEvents* events;
Chunks(uint32_t w, uint32_t d, int32_t ox, int32_t oz,
WorldFiles* worldFiles, LevelEvents* events, const Content* content);
WorldFiles* worldFiles, Level* level);
~Chunks() = default;
bool putChunk(const std::shared_ptr<Chunk>& chunk);
@@ -95,6 +96,8 @@ public:
void resize(uint32_t newW, uint32_t newD);
void saveAndClear();
void save(Chunk* chunk);
void saveAll();
};
#endif // VOXELS_CHUNKS_HPP_