2013-07-29 07:13:03 -04:00
|
|
|
// NBTChunkSerializer.h
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fwd:
|
|
|
|
class cFastNBTWriter;
|
2019-09-24 08:20:50 -04:00
|
|
|
class cWorld;
|
2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-24 08:20:50 -04:00
|
|
|
/** Saves the chunk data into a NBT format, used by the Anvil storage.
|
|
|
|
The Writer is expected to be set up so that the serializer can write the chunk's top level "Level" NBT tag immediately.
|
|
|
|
Provides a single static entry point that does all the work, through a hidden worker class in the CPP file. */
|
|
|
|
class NBTChunkSerializer
|
2013-07-29 07:13:03 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2019-09-24 08:20:50 -04:00
|
|
|
/** Serializes the chunk into the specified writer.
|
|
|
|
Returns true on success, false on failure (chunk not present etc.) */
|
|
|
|
static bool serialize(const cWorld & aWorld, cChunkCoords aCoords, cFastNBTWriter & aWriter);
|
|
|
|
};
|