2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
// cSimulatorManager.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-23 18:09:57 -04:00
|
|
|
#include "Simulator.h"
|
2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-28 02:42:45 -05:00
|
|
|
// fwd: Chunk.h
|
|
|
|
class cChunk;
|
|
|
|
|
2013-02-28 08:39:20 -05:00
|
|
|
// fwd: World.h
|
|
|
|
class cWorld;
|
|
|
|
|
2013-02-28 02:42:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
class cSimulatorManager
|
|
|
|
{
|
|
|
|
public:
|
2013-02-28 08:39:20 -05:00
|
|
|
cSimulatorManager(cWorld & a_World);
|
2012-06-14 09:06:06 -04:00
|
|
|
~cSimulatorManager();
|
|
|
|
|
2012-10-27 03:51:01 -04:00
|
|
|
void Simulate(float a_Dt);
|
2013-02-28 08:39:20 -05:00
|
|
|
|
|
|
|
void SimulateChunk(float a_DT, int a_ChunkX, int a_ChunkZ, cChunk * a_Chunk);
|
|
|
|
|
2013-02-28 02:42:45 -05:00
|
|
|
void WakeUp(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk);
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2014-10-25 16:54:00 -04:00
|
|
|
void RegisterSimulator(cSimulator * a_Simulator, int a_Rate); // Takes ownership of the simulator object!
|
2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
protected:
|
2014-10-25 16:54:00 -04:00
|
|
|
typedef std::vector <std::pair<cSimulator *, int> > cSimulators;
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2013-02-28 08:39:20 -05:00
|
|
|
cWorld & m_World;
|
2012-06-14 09:06:06 -04:00
|
|
|
cSimulators m_Simulators;
|
|
|
|
long long m_Ticks;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|