From 9bb61e6e2e23fc8a66dbc95d918f23b89ba60314 Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 20 Jan 2014 09:17:24 -0800 Subject: Seperated BlockArea From World If anyone can come up with a better name for the interface I'll change it, It contians to methods which do compleatly unrelated things --- src/BlockArea.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/BlockArea.h') diff --git a/src/BlockArea.h b/src/BlockArea.h index 075cc99ec..ae23c76c6 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -12,13 +12,10 @@ #pragma once +#include "ForEachChunkProvider.h" - -// fwd: World.h -class cWorld; - // fwd: FastNBT.h class cParsedNBT; @@ -68,13 +65,13 @@ public: void SetOrigin(int a_OriginX, int a_OriginY, int a_OriginZ); /// Reads an area of blocks specified. Returns true if successful. All coords are inclusive. - bool Read(cWorld * a_World, int a_MinBlockX, int a_MaxBlockX, int a_MinBlockY, int a_MaxBlockY, int a_MinBlockZ, int a_MaxBlockZ, int a_DataTypes = baTypes | baMetas); + bool Read(cForEachChunkProvider * a_ForEachChunkProvider, int a_MinBlockX, int a_MaxBlockX, int a_MinBlockY, int a_MaxBlockY, int a_MinBlockZ, int a_MaxBlockZ, int a_DataTypes = baTypes | baMetas); // TODO: Write() is not too good an interface: if it fails, there's no way to repeat only for the parts that didn't write // A better way may be to return a list of cBlockAreas for each part that didn't succeed writing, so that the caller may try again /// Writes the area back into cWorld at the coords specified. Returns true if successful in all chunks, false if only partially / not at all - bool Write(cWorld * a_World, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes = baTypes | baMetas); + bool Write(cForEachChunkProvider * a_ForEachChunkProvider, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes = baTypes | baMetas); /// Copies this object's contents into the specified BlockArea. void CopyTo(cBlockArea & a_Into) const; -- cgit v1.2.3 From 4f09e8df6ecf20bd50573b7bf40c46f5ade21124 Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 20 Jan 2014 09:59:12 -0800 Subject: Moved Schematic file methods to seperate class --- src/BlockArea.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src/BlockArea.h') diff --git a/src/BlockArea.h b/src/BlockArea.h index ae23c76c6..59bc0f241 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -15,14 +15,6 @@ #include "ForEachChunkProvider.h" - -// fwd: FastNBT.h -class cParsedNBT; - - - - - // tolua_begin class cBlockArea { @@ -82,12 +74,6 @@ public: /// For testing purposes only, dumps the area into a file. void DumpToRawFile(const AString & a_FileName); - /// Loads an area from a .schematic file. Returns true if successful - bool LoadFromSchematicFile(const AString & a_FileName); - - /// Saves the area into a .schematic file. Returns true if successful - bool SaveToSchematicFile(const AString & a_FileName); - /// Crops the internal contents by the specified amount of blocks from each border. void Crop(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ); @@ -230,6 +216,7 @@ public: protected: friend class cChunkDesc; + friend class cSchematicFileSerializer; class cChunkReader : public cChunkDataCallback @@ -288,9 +275,6 @@ protected: // Expand helpers: void ExpandBlockTypes(int a_SubMinX, int a_AddMaxX, int a_SubMinY, int a_AddMaxY, int a_SubMinZ, int a_AddMaxZ); void ExpandNibbles (NIBBLEARRAY & a_Array, int a_SubMinX, int a_AddMaxX, int a_SubMinY, int a_AddMaxY, int a_SubMinZ, int a_AddMaxZ); - - /// Loads the area from a schematic file uncompressed and parsed into a NBT tree. Returns true if successful. - bool LoadFromSchematicNBT(cParsedNBT & a_NBT); /// Sets the specified datatypes at the specified location. void RelSetData( -- cgit v1.2.3