mirror of
https://git.stillkill.net/MinecraftLeak/MinecraftConsoles-141217.git
synced 2026-10-22 13:22:18 +01:00
Initial commit
This commit is contained in:
commit
2dfcaaa842
5375 files changed
+978475
No files matched your search
@@ -0,0 +1,47 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "StructureFeatureSavedData.h"
|
||||
|
||||
wstring StructureFeatureSavedData::TAG_FEATURES = L"Features";
|
||||
|
||||
StructureFeatureSavedData::StructureFeatureSavedData(const wstring &idName) : SavedData(idName)
|
||||
{
|
||||
this->pieceTags = new CompoundTag(TAG_FEATURES);
|
||||
}
|
||||
|
||||
StructureFeatureSavedData::~StructureFeatureSavedData()
|
||||
{
|
||||
delete pieceTags;
|
||||
}
|
||||
|
||||
void StructureFeatureSavedData::load(CompoundTag *tag)
|
||||
{
|
||||
this->pieceTags = tag->getCompound(TAG_FEATURES);
|
||||
}
|
||||
|
||||
void StructureFeatureSavedData::save(CompoundTag *tag)
|
||||
{
|
||||
tag->put(TAG_FEATURES, pieceTags->copy() );
|
||||
}
|
||||
|
||||
CompoundTag *StructureFeatureSavedData::getFeatureTag(int chunkX, int chunkZ)
|
||||
{
|
||||
return pieceTags->getCompound(createFeatureTagId(chunkX, chunkZ));
|
||||
}
|
||||
|
||||
void StructureFeatureSavedData::putFeatureTag(CompoundTag *tag, int chunkX, int chunkZ)
|
||||
{
|
||||
wstring name = createFeatureTagId(chunkX, chunkZ);
|
||||
tag->setName(name);
|
||||
pieceTags->put(name, tag);
|
||||
}
|
||||
|
||||
wstring StructureFeatureSavedData::createFeatureTagId(int chunkX, int chunkZ)
|
||||
{
|
||||
return L"[" + _toString<int>(chunkX) + L"," + _toString<int>(chunkZ) + L"]";
|
||||
}
|
||||
|
||||
CompoundTag *StructureFeatureSavedData::getFullTag()
|
||||
{
|
||||
return pieceTags;
|
||||
}
|
||||
Reference in new issue
Block a user