summaryrefslogtreecommitdiffstats
path: root/source/WorldStorage.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-24 12:14:34 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-24 12:14:34 +0100
commitb69ac328c06ca77fb4c692f15b0ecc5d4246ec72 (patch)
tree50fb81d24e7849bed22b1acf04cad62f9b514450 /source/WorldStorage.h
parentEncapsulated 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) (diff)
downloadcuberite-b69ac328c06ca77fb4c692f15b0ecc5d4246ec72.tar
cuberite-b69ac328c06ca77fb4c692f15b0ecc5d4246ec72.tar.gz
cuberite-b69ac328c06ca77fb4c692f15b0ecc5d4246ec72.tar.bz2
cuberite-b69ac328c06ca77fb4c692f15b0ecc5d4246ec72.tar.lz
cuberite-b69ac328c06ca77fb4c692f15b0ecc5d4246ec72.tar.xz
cuberite-b69ac328c06ca77fb4c692f15b0ecc5d4246ec72.tar.zst
cuberite-b69ac328c06ca77fb4c692f15b0ecc5d4246ec72.zip
Diffstat (limited to '')
-rw-r--r--source/WorldStorage.h50
1 files changed, 6 insertions, 44 deletions
diff --git a/source/WorldStorage.h b/source/WorldStorage.h
index 047c358ba..da78b69f2 100644
--- a/source/WorldStorage.h
+++ b/source/WorldStorage.h
@@ -22,45 +22,8 @@
-/** Interface between cWorld and cWorldStorage, contains all calls into cWorld that cWorldStorage needs
-Defining this as an interface lets us re-use the cWorldStorage outside of MC-Server's main executable,
-for example for tools such as storage converters or chunk analytics
-*/
-class cWSInterface
-{
-public:
- /// Asks the world if the chunk is fully valid
- virtual bool WSIIsChunkValid(int a_ChunkX, int a_ChunkY, int a_ChunkZ) = 0;
-
- /// Marks the chunk as being saved
- virtual void WSIMarkChunkSaving(int a_ChunkX, int a_ChunkY, int a_ChunkZ) = 0;
-
- /// Marks the chunk as having been saved (if there was no change since the last MarkSaving)
- virtual void WSIMarkChunkSaved(int a_ChunkX, int a_ChunkY, int a_ChunkZ) = 0;
-
- /// Marks the chunk as unable to load
- virtual void WSIChunkLoadFailed(int a_ChunkX, int a_ChunkY, int a_ChunkZ) = 0;
-
- /// Called when chunk generation has been specified for a chunk that cannot be loaded
- virtual void WSIGenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ) = 0;
-
- /// Marks the chunk as having been saved (if there was no change since the last MarkSaving)
- virtual bool WSIGetChunkData(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cChunkDataCallback & a_Callback) = 0;
-
- /// Gets the folder where the world is saved
- virtual AString WSIGetFolder(void) = 0;
-
- 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
- ) = 0;
-} ;
+// fwd:
+class cWorld;
@@ -70,7 +33,7 @@ public:
class cWSSchema abstract
{
public:
- cWSSchema(cWSInterface * a_WSI) : m_WSI(a_WSI) {}
+ cWSSchema(cWorld * a_World) : m_World(a_World) {}
virtual ~cWSSchema() {} // Force the descendants' destructors to be virtual
virtual bool LoadChunk(const cChunkCoords & a_Chunk) = 0;
@@ -79,7 +42,7 @@ public:
protected:
- cWSInterface * m_WSI;
+ cWorld * m_World;
} ;
typedef std::list<cWSSchema *> cWSSchemaList;
@@ -140,7 +103,7 @@ public:
void UnqueueLoad(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
void UnqueueSave(const cChunkCoords & a_Chunk);
- bool Start(cWSInterface * a_WSI, const AString & a_StorageSchemaName); // Hide the cIsThread's Start() method, we need to provide args
+ bool Start(cWorld * a_World, const AString & a_StorageSchemaName); // Hide the cIsThread's Start() method, we need to provide args
void WaitForFinish(void);
void WaitForQueuesEmpty(void);
@@ -161,8 +124,7 @@ protected:
typedef std::list<sChunkLoad> sChunkLoadQueue;
- cWSInterface * m_WSI;
-
+ cWorld * m_World;
AString m_StorageSchemaName;
// Both queues are locked by the same CS