From be31652c40af10b0410c76c6bd37b60717c385be Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 23 Mar 2012 21:12:48 +0000 Subject: Encapsulated cWorld functions needed in cWorldStorage into an interface, so that cWorldStorage can actually be used outside of MC-Server (such as storage conversion tools and chunk analyzers) git-svn-id: http://mc-server.googlecode.com/svn/trunk@427 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWorld.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'source/cWorld.h') diff --git a/source/cWorld.h b/source/cWorld.h index a8591af65..fd5f800fd 100644 --- a/source/cWorld.h +++ b/source/cWorld.h @@ -45,7 +45,8 @@ typedef cItemCallback cEntityCallback; -class cWorld //tolua_export +class cWorld : //tolua_export + public cWSInterface { //tolua_export public: @@ -257,6 +258,26 @@ public: cWorldStorage & GetStorage (void) { return m_Storage; } cChunkMap * GetChunkMap (void) { return m_ChunkMap; } +protected: + // cWSInterface overrides: + virtual bool WSIIsChunkValid(int a_ChunkX, int a_ChunkY, int a_ChunkZ) override; + virtual void WSIMarkChunkSaving(int a_ChunkX, int a_ChunkY, int a_ChunkZ) override; + virtual void WSIMarkChunkSaved(int a_ChunkX, int a_ChunkY, int a_ChunkZ) override; + virtual void WSIChunkLoadFailed(int a_ChunkX, int a_ChunkY, int a_ChunkZ) override; + virtual void WSIGenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ) override; + virtual bool WSIGetChunkData(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cChunkDataCallback & a_Callback) override; + virtual AString WSIGetFolder(void) override; + virtual void WSIChunkDataLoaded( + int a_ChunkX, int a_ChunkY, int a_ChunkZ, + const BLOCKTYPE * a_BlockTypes, + const BLOCKTYPE * a_BlockMeta, + const BLOCKTYPE * a_BlockLight, + const BLOCKTYPE * a_BlockSkyLight, + const cChunkDef::HeightMap * a_HeightMap, + cEntityList & a_Entities, + cBlockEntityList & a_BlockEntities + ) override; + private: friend class cRoot; -- cgit v1.2.3