Files
minecraft-pe-0.6.1/src/world/level/storage/RegionFile.h
2026-03-02 22:04:18 +03:00

32 lines
743 B
C++
Executable File

#ifndef NET_MINECRAFT_WORLD_LEVEL_STORAGE__RegionFile_H__
#define NET_MINECRAFT_WORLD_LEVEL_STORAGE__RegionFile_H__
#include <map>
#include <string>
#include "../../../raknet/BitStream.h"
typedef std::map<int, bool> FreeSectorMap;
class RegionFile
{
public:
RegionFile(const std::string& basePath);
virtual ~RegionFile();
bool open();
bool readChunk(int x, int z, RakNet::BitStream** destChunkData);
bool writeChunk(int x, int z, RakNet::BitStream& chunkData);
private:
bool write(int sector, RakNet::BitStream& chunkData);
void close();
FILE* file;
std::string filename;
int* offsets;
int* emptyChunk;
FreeSectorMap sectorFree;
};
#endif /*NET_MINECRAFT_WORLD_LEVEL_STORAGE__RegionFile_H__*/