summaryrefslogtreecommitdiffstats
path: root/source/WorldStorage.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-14 21:56:09 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-14 21:56:09 +0100
commit0b24efeb005e293a026f2ac8666020cea8316578 (patch)
tree4523c34112fbec3f056337191c00bddb6f7253d0 /source/WorldStorage.h
parentFixed the server not waiting for the world to save completely before stopping (diff)
downloadcuberite-0b24efeb005e293a026f2ac8666020cea8316578.tar
cuberite-0b24efeb005e293a026f2ac8666020cea8316578.tar.gz
cuberite-0b24efeb005e293a026f2ac8666020cea8316578.tar.bz2
cuberite-0b24efeb005e293a026f2ac8666020cea8316578.tar.lz
cuberite-0b24efeb005e293a026f2ac8666020cea8316578.tar.xz
cuberite-0b24efeb005e293a026f2ac8666020cea8316578.tar.zst
cuberite-0b24efeb005e293a026f2ac8666020cea8316578.zip
Diffstat (limited to '')
-rw-r--r--source/WorldStorage.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/source/WorldStorage.h b/source/WorldStorage.h
index 0845a7ce7..da78b69f2 100644
--- a/source/WorldStorage.h
+++ b/source/WorldStorage.h
@@ -14,7 +14,7 @@
#ifndef WORLDSTORAGE_H_INCLUDED
#define WORLDSTORAGE_H_INCLUDED
-#include "cChunk.h"
+#include "ChunkDef.h"
#include "cIsThread.h"
#include <json/json.h>
@@ -23,8 +23,7 @@
// fwd:
-class cEntity;
-class cBlockEntity;
+class cWorld;
@@ -54,20 +53,19 @@ typedef std::list<cWSSchema *> cWSSchemaList;
/// Helper class for serializing a chunk into Json
class cJsonChunkSerializer :
- public cChunkDataCallback
+ public cChunkDataCollector
{
public:
cJsonChunkSerializer(void);
Json::Value & GetRoot (void) {return m_Root; }
- AString & GetBlockData(void) {return m_BlockData; }
+ BLOCKTYPE * GetBlockData(void) {return m_BlockData; }
bool HasJsonData (void) const {return m_HasJsonData; }
protected:
-
- // BlockData is serialized into string
- AString m_BlockData;
+
+ // NOTE: block data is serialized into inherited cChunkDataCollector's m_BlockData[] array
// Entities and BlockEntities are serialized to Json
Json::Value m_Root;
@@ -76,10 +74,9 @@ protected:
Json::Value m_AllSigns;
bool m_HasJsonData;
- // cChunkDataCallback overrides:
- virtual void BlockData (const char * a_Data) override;
- virtual void Entity (cEntity * a_Entity) override;
- virtual void BlockEntity(cBlockEntity * a_Entity) override;
+ // cChunkDataCollector overrides:
+ virtual void Entity (cEntity * a_Entity) override;
+ virtual void BlockEntity (cBlockEntity * a_Entity) override;
} ;