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
+1 -1
View File
@@ -38,7 +38,7 @@ Level::Level(
settings.chunks.padding.get()
) * 2;
chunks = std::make_unique<Chunks>(
matrixSize, matrixSize, 0, 0, this->world->wfile.get(), events.get(), content
matrixSize, matrixSize, 0, 0, this->world->wfile.get(), this
);
lighting = std::make_unique<Lighting>(content, chunks.get());
+1 -8
View File
@@ -51,14 +51,7 @@ void World::updateTimers(float delta) {
void World::write(Level* level) {
const Content* content = level->content;
Chunks* chunks = level->chunks.get();
auto& regions = wfile->getRegions();
for (size_t i = 0; i < chunks->volume; i++) {
if (auto chunk = chunks->chunks[i]) {
regions.put(chunk.get());
}
}
level->chunks->saveAll();
wfile->write(this, content);
auto playerFile = dynamic::Map();