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