summaryrefslogtreecommitdiffstats
path: root/src/Simulator/Simulator.h
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2014-10-11 19:32:21 +0200
committerAlexander Harkness <bearbin@gmail.com>2014-10-11 19:32:21 +0200
commit93833069a80fe4aec33a95148df39ad40671ddaf (patch)
tree2e6a335a60e618b5fe456ca8a586a2c5448c8c87 /src/Simulator/Simulator.h
parentReverted submodule changes. (diff)
parentMerge pull request #1528 from kjanku1/master (diff)
downloadcuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar.gz
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar.bz2
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar.lz
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar.xz
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar.zst
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.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;
} ;