From 0b044e1c83a62c266afaf0852ccbd5e7b01cec5e Mon Sep 17 00:00:00 2001 From: Tycho Date: Thu, 11 Sep 2014 17:48:21 +0100 Subject: Possibly decoupled IncrementalRedstoneSimulator from the rest of the server THis wil hopefully allow for unit testing --- src/Simulator/Simulator.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/Simulator/Simulator.h') diff --git a/src/Simulator/Simulator.h b/src/Simulator/Simulator.h index 4d9a18867..ff53b17e1 100644 --- a/src/Simulator/Simulator.h +++ b/src/Simulator/Simulator.h @@ -8,17 +8,12 @@ -class cWorld; -class cChunk; - - - - +template 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 +21,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 +30,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 +38,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; } ; -- cgit v1.2.3