81 a_Writer.
AddByteArray(
"colors",
reinterpret_cast<const char *
>(Data.data()), Data.size());
101 unsigned int Scale =
static_cast<unsigned int>(a_NBT.
GetByte(CurrLine));
120 unsigned int Width =
static_cast<unsigned int>(a_NBT.
GetShort(CurrLine));
131 unsigned int Height =
static_cast<unsigned int>(a_NBT.
GetShort(CurrLine));
142 int CenterX = a_NBT.
GetInt(CurrLine);
149 int CenterZ = a_NBT.
GetInt(CurrLine);
191 cParsedNBT NBT({
reinterpret_cast<const std::byte *
>(Data.data()), Data.size() });
201 m_MapCount =
static_cast<unsigned int>(NBT.GetShort(CurrLine) + 1);
eDimension
Dimension of a world.
void Write(const std::string &a_FileName, ContiguousByteBufferView a_Contents)
Writes a_Contents into file, compressing it along the way.
Compression::Result ReadRestOfFile(const std::string &a_FileName)
Reads the rest of the file and returns the decompressed contents.
Encapsulates an in-game world map.
eDimension GetDimension(void) const
unsigned int GetHeight(void) const
const cColorList & GetData(void) const
unsigned int GetWidth(void) const
void SetScale(unsigned int a_Scale)
unsigned int GetNumPixels(void) const
int GetCenterZ(void) const
unsigned int GetScale(void) const
int GetCenterX(void) const
std::vector< ColorID > cColorList
unsigned int GetID(void) const
cColorList m_Data
Column-major array of colours.
static bool CreateFolder(const AString &a_FolderPath)
Creates a new folder with the specified name.
static char PathSeparator()
bool Open(const AString &iFileName, eMode iMode)
static AString ReadWholeFile(const AString &a_FileName)
Returns the entire contents of the specified file as a string.
int Write(const void *a_Buffer, size_t a_NumBytes)
Writes up to a_NumBytes bytes from a_Buffer, returns the number of bytes actually written,...
virtual eDimension GetDimension(void) const override
Parses and contains the parsed data Also implements data accessor functions for tree traversal and va...
Int16 GetShort(int a_Tag) const
Returns the value stored in a Short tag.
const std::byte * GetData(int a_Tag) const
Returns the data stored in this tag.
eTagType GetType(int a_Tag) const
int FindChildByName(int a_Tag, const AString &a_Name) const
Returns the direct child tag of the specified name, or -1 if no such tag.
unsigned char GetByte(int a_Tag) const
Returns the value stored in a Byte tag.
Int32 GetInt(int a_Tag) const
Returns the value stored in an Int tag.
void AddByteArray(const AString &a_Name, const char *a_Value, size_t a_NumElements)
void AddByte(const AString &a_Name, unsigned char a_Value)
void AddShort(const AString &a_Name, Int16 a_Value)
void AddInt(const AString &a_Name, Int32 a_Value)
void BeginCompound(const AString &a_Name)
ContiguousByteBufferView GetResult(void) const
void SaveMapToNBT(cFastNBTWriter &a_Writer)
bool LoadMapFromNBT(const cParsedNBT &a_NBT)
bool Load(void)
Try to load the map.
cMapSerializer(const AString &a_WorldName, cMap *a_Map)
bool Save(void)
Try to save the map.
bool Save(void)
Try to save the ID counts.
bool Load(void)
Try to load the ID counts.
cIDCountSerializer(const AString &a_WorldName)