aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ZoneFile.h
blob: d7b8cc821c60eb239bda60f66d75c6e71ee6c952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include "ZonedChunkStorage.h"
#include "NbtSlotFile.h"
#include "ZoneIo.h"

class ZoneFile
{
public:
    static const int FILE_HEADER_SIZE = 1024 * 4;

private:
    static const int MAGIC_NUMBER = 0x13737000;

	static const int slotsLength;

    shortArray slots;
    short slotCount;

public:
    __int64 lastUse;

private:
    HANDLE channel;

public:
    __int64 key;
    File file;

    NbtSlotFile *entityFile;

    ZoneFile(__int64 key, File file, File entityFile);
	~ZoneFile();

    void readHeader();

    void writeHeader();

public:
    void close();
    ZoneIo *getZoneIo(int slot);
    bool containsSlot(int slot);
};