]> git.localhorst.tv Git - blank.git/blobdiff - src/world/WorldSave.hpp
different limits for reading and generating chunks
[blank.git] / src / world / WorldSave.hpp
index 7e40fc8ef5f05f0e2eedb2ab4261fbd62cc4eb18..b08b373f3e6719ee97dbb0ab21951a38e1d4da5b 100644 (file)
@@ -1,8 +1,10 @@
 #ifndef BLANK_WORLD_WORLDSAVE_HPP_
 #define BLANK_WORLD_WORLDSAVE_HPP_
 
+#include "Chunk.hpp"
 #include "World.hpp"
 
+#include <memory>
 #include <string>
 
 
@@ -14,14 +16,24 @@ public:
        explicit WorldSave(const std::string &path);
 
 public:
+       // whole save
        bool Exists() const noexcept;
-
-       void Create(const World::Config &) const;
        void Read(World::Config &) const;
+       void Write(const World::Config &) const;
+
+       // single chunk
+       bool Exists(const Chunk::Pos &) const noexcept;
+       void Read(Chunk &) const;
+       void Write(Chunk &) const;
+
+       const char *ChunkPath(const Chunk::Pos &) const;
 
 private:
        std::string root_path;
        std::string conf_path;
+       std::string chunk_path;
+       std::size_t chunk_bufsiz;
+       std::unique_ptr<char[]> chunk_buf;
 
 };