summaryrefslogtreecommitdiffstats
path: root/source/cWorld.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-08 13:36:54 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-08 13:36:54 +0100
commit32880153ab76830311d8a1db3a157cd5ac6e5d9c (patch)
treec7c77a8c5b6bf86f3f18655e8ec976c30a5c8c15 /source/cWorld.h
parentcSocketThreads plugged in for cClientHandle reading. Sending still kept the old way. Please help me test this commit thoroughly, this is a change that can break on subtleties. (diff)
downloadcuberite-32880153ab76830311d8a1db3a157cd5ac6e5d9c.tar
cuberite-32880153ab76830311d8a1db3a157cd5ac6e5d9c.tar.gz
cuberite-32880153ab76830311d8a1db3a157cd5ac6e5d9c.tar.bz2
cuberite-32880153ab76830311d8a1db3a157cd5ac6e5d9c.tar.lz
cuberite-32880153ab76830311d8a1db3a157cd5ac6e5d9c.tar.xz
cuberite-32880153ab76830311d8a1db3a157cd5ac6e5d9c.tar.zst
cuberite-32880153ab76830311d8a1db3a157cd5ac6e5d9c.zip
Diffstat (limited to '')
-rw-r--r--source/cWorld.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/source/cWorld.h b/source/cWorld.h
index c5d036141..e81d3e1df 100644
--- a/source/cWorld.h
+++ b/source/cWorld.h
@@ -1,3 +1,4 @@
+
#pragma once
#ifndef _WIN32
@@ -10,6 +11,7 @@ enum ENUM_ITEM_ID;
#include "cSimulatorManager.h"
#include "ptr_cChunk.h"
+#include "MersenneTwister.h"
@@ -23,7 +25,6 @@ class cLavaSimulator;
class cSandSimulator;
class cChunkMap;
class cItem;
-class cCriticalSection;
class cPlayer;
class cClientHandle;
class cChunk;
@@ -159,17 +160,19 @@ public:
int GetWeather() { return m_Weather; }; //tolua_export
cWorldGenerator* GetWorldGenerator() { return m_WorldGenerator; }
+
private:
+
friend class cRoot;
+
cWorld( const char* a_WorldName );
~cWorld();
struct sWorldState;
sWorldState* m_pState;
-
- void AddToRemoveEntityQueue( cEntity & a_Entity );
- void RemoveEntity( cEntity* a_Entity );
- void UnloadUnusedChunks();
+
+ // This random generator is to be used only in the Tick() method, and thus only in the World-Tick-thread (MTRand is not exactly thread-safe)
+ MTRand m_TickRand;
double m_SpawnX;
double m_SpawnY;
@@ -206,4 +209,15 @@ private:
unsigned int m_WorldSeed;
int m_Weather;
+
+ void TickWeather(float a_Dt); // Handles weather each tick
+
+ void AddToRemoveEntityQueue( cEntity & a_Entity );
+ void RemoveEntity( cEntity* a_Entity );
+ void UnloadUnusedChunks();
+
}; //tolua_export
+
+
+
+