summaryrefslogtreecommitdiffstats
path: root/src/SpawnPrepare.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-08-22 14:34:43 +0200
committerMattes D <github@xoft.cz>2017-08-22 14:34:43 +0200
commitcc2d719c59446804f59a956b98fe9f7702da7515 (patch)
tree9c43009ecbdfc81d968e5fea5ac9d1aaa366b758 /src/SpawnPrepare.h
parentAdded .editorconfig (#3936) (diff)
downloadcuberite-cc2d719c59446804f59a956b98fe9f7702da7515.tar
cuberite-cc2d719c59446804f59a956b98fe9f7702da7515.tar.gz
cuberite-cc2d719c59446804f59a956b98fe9f7702da7515.tar.bz2
cuberite-cc2d719c59446804f59a956b98fe9f7702da7515.tar.lz
cuberite-cc2d719c59446804f59a956b98fe9f7702da7515.tar.xz
cuberite-cc2d719c59446804f59a956b98fe9f7702da7515.tar.zst
cuberite-cc2d719c59446804f59a956b98fe9f7702da7515.zip
Diffstat (limited to 'src/SpawnPrepare.h')
-rw-r--r--src/SpawnPrepare.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/SpawnPrepare.h b/src/SpawnPrepare.h
index 6d001b5f7..62daf1f84 100644
--- a/src/SpawnPrepare.h
+++ b/src/SpawnPrepare.h
@@ -6,10 +6,15 @@ class cWorld;
/** Generates and lights the spawn area of the world. Runs as a separate thread. */
-class cSpawnPrepare
+class cSpawnPrepare:
+ public std::enable_shared_from_this<cSpawnPrepare>
{
-
+ /** Private tag allows public constructors that can only be used with private access. */
+ struct sMakeSharedTag {};
public:
+
+ cSpawnPrepare(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance, int a_FirstIdx, sMakeSharedTag);
+
static void PrepareChunks(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance);
protected:
@@ -36,8 +41,6 @@ protected:
/** Number of chunks prepared when the last progress report was emitted. */
int m_LastReportChunkCount;
- cSpawnPrepare(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance, int a_FirstIdx);
-
void PreparedChunkCallback(int a_ChunkX, int a_ChunkZ);
/** Decodes the index into chunk coords. Provides the specific chunk ordering. */