summaryrefslogtreecommitdiffstats
path: root/src/Simulator/Simulator.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-09-27 19:40:00 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-09-27 19:40:00 +0200
commitd1814d2d67cdaa4fbcbd10a1af290412c29441af (patch)
treeeb132621bef87b82311f70ead69694c4c88690c9 /src/Simulator/Simulator.h
parente.t.c. -> etc. (diff)
parentMerge pull request #1461 from mc-server/RedstoneFix (diff)
downloadcuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar.gz
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar.bz2
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar.lz
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar.xz
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar.zst
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.zip
Diffstat (limited to 'src/Simulator/Simulator.h')
-rw-r--r--src/Simulator/Simulator.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/Simulator/Simulator.h b/src/Simulator/Simulator.h
index 4d9a18867..7cc2f1344 100644
--- a/src/Simulator/Simulator.h
+++ b/src/Simulator/Simulator.h
@@ -2,23 +2,17 @@
#pragma once
#include "../Vector3.h"
-#include "inifile/iniFile.h"
-class cWorld;
-class cChunk;
-
-
-
-
+template <class ChunkType, class WorldType>
class cSimulator
{
public:
- cSimulator(cWorld & a_World);
+ cSimulator(WorldType & a_World);
virtual ~cSimulator();
/// Called in each tick, a_Dt is the time passed since the last tick, in msec
@@ -26,7 +20,7 @@ public:
/// Called in each tick for each chunk, a_Dt is the time passed since the last tick, in msec; direct access to chunk data available
virtual void SimulateChunk(float a_Dt, int a_ChunkX,
- int a_ChunkZ, cChunk * a_Chunk)
+ int a_ChunkZ, ChunkType * a_Chunk)
{
UNUSED(a_Dt);
UNUSED(a_ChunkX);
@@ -35,7 +29,7 @@ public:
}
/// Called when a block changes
- virtual void WakeUp(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk);
+ virtual void WakeUp(int a_BlockX, int a_BlockY, int a_BlockZ, ChunkType * a_Chunk);
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) = 0;
@@ -43,9 +37,9 @@ protected:
friend class cChunk; // Calls AddBlock() in its WakeUpSimulators() function, to speed things up
/// Called to simulate a new block
- virtual void AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) = 0;
+ virtual void AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, ChunkType * a_Chunk) = 0;
- cWorld & m_World;
+ WorldType & m_World;
} ;