1
0
cuberite-2a/src/WorldStorage/EnchantmentSerializer.h
Tycho e14ddff1c0 Spilt Writing of Enchantments to seperate class
Created a new class cEnchantmentSerializer to serilize Enchantments to NBT.
This breaks a dependecy chain between cChunkGenerator and cWorld.
cEnchantmentSerializer is seperate from NBTWriter as it needs to access private members of cEnchantments
so having it seperate reduces the spread of the frein modifier
2014-01-19 07:38:59 -08:00

18 lines
553 B
C++

#pragma once
#include "Enchantments.h"
class cEnchantmentSerializer
{
public:
/// Writes the enchantments into the specified NBT writer; begins with the LIST tag of the specified name ("ench" or "StoredEnchantments")
static void WriteToNBTCompound(cEnchantments const& a_Enchantments, cFastNBTWriter & a_Writer, const AString & a_ListTagName);
/// Reads the enchantments from the specified NBT list tag (ench or StoredEnchantments)
static void ParseFromNBT(cEnchantments& a_Enchantments, const cParsedNBT & a_NBT, int a_EnchListTagIdx);
};