World structure update + new blocks

This commit is contained in:
MihailRis
2023-11-24 02:20:13 +03:00
parent cc556bc19b
commit 275e4af9fd
9 changed files with 70 additions and 4 deletions
+6 -1
View File
@@ -23,6 +23,8 @@
class Player;
class Chunk;
class Content;
class ContentIndices;
struct WorldRegion {
ubyte** chunksData;
@@ -38,9 +40,11 @@ struct WorldInfo {
class WorldFiles {
void writeWorldInfo(const WorldInfo& info);
std::filesystem::path getRegionsFolder() const;
std::filesystem::path getRegionFile(int x, int y) const;
std::filesystem::path getPlayerFile() const;
std::filesystem::path getWorldFile() const;
std::filesystem::path getBlockIndicesFile() const;
public:
std::unordered_map<glm::ivec2, WorldRegion> regions;
std::filesystem::path directory;
@@ -58,7 +62,8 @@ public:
ubyte* getChunk(int x, int y);
void writeRegion(int x, int y, WorldRegion& entry);
void writePlayer(Player* player);
void write(const WorldInfo info);
void write(const WorldInfo info, const Content* content);
void writeIndices(const ContentIndices* indices);
};
#endif /* FILES_WORLDFILES_H_ */