From 0b24efeb005e293a026f2ac8666020cea8316578 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 14 Mar 2012 20:56:09 +0000 Subject: Split chunk data into separate arrays; decoupled most sources from cChunk.h dependency git-svn-id: http://mc-server.googlecode.com/svn/trunk@411 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/WorldStorage.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'source/WorldStorage.h') 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 @@ -23,8 +23,7 @@ // fwd: -class cEntity; -class cBlockEntity; +class cWorld; @@ -54,20 +53,19 @@ typedef std::list 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; } ; -- cgit v1.2.3