1 #ifndef BLANK_IO_WORLDSAVE_HPP_
2 #define BLANK_IO_WORLDSAVE_HPP_
4 #include "../world/Chunk.hpp"
5 #include "../world/Generator.hpp"
6 #include "../world/World.hpp"
19 explicit WorldSave(const std::string &path);
23 bool Exists() const noexcept;
24 void Read(World::Config &) const;
25 void Write(const World::Config &) const;
26 void Read(Generator::Config &) const;
27 void Write(const Generator::Config &) const;
30 bool Exists(const Player &) const;
31 void Read(Player &) const;
32 void Write(const Player &) const;
33 std::string PlayerPath(const Player &) const;
36 bool Exists(const Chunk::Pos &) const noexcept;
37 void Read(Chunk &) const;
38 void Write(Chunk &) const;
39 const char *ChunkPath(const Chunk::Pos &) const;
42 std::string root_path;
43 std::string world_conf_path;
44 std::string gen_conf_path;
45 std::string player_path;
46 std::string chunk_path;
47 std::size_t chunk_bufsiz;
48 std::unique_ptr<char[]> chunk_buf;