forked from Kolyah35/minecraft-pe-0.6.1
the whole game
This commit is contained in:
31
src/world/level/storage/RegionFile.h
Executable file
31
src/world/level/storage/RegionFile.h
Executable file
@@ -0,0 +1,31 @@
|
||||
#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__*/
|
||||
Reference in New Issue
Block a user