1
0

Merge pull request #1471 from mc-server/redstoneData

Use factory method to construct redstone simulator data
This commit is contained in:
Mattes D 2014-09-28 22:05:05 +02:00
commit 1422176d13
4 changed files with 13 additions and 1 deletions

View File

@ -92,7 +92,7 @@ cChunk::cChunk(
m_NeighborZP(a_NeighborZP),
m_WaterSimulatorData(a_World->GetWaterSimulator()->CreateChunkData()),
m_LavaSimulatorData (a_World->GetLavaSimulator ()->CreateChunkData()),
m_RedstoneSimulatorData(NULL),
m_RedstoneSimulatorData(a_World->GetRedstoneSimulator()->CreateChunkData()),
m_AlwaysTicked(0)
{
if (a_NeighborXM != NULL)

View File

@ -27,6 +27,11 @@ public:
{
}
~cIncrementalRedstoneSimulator();
virtual cRedstoneSimulatorChunkData * CreateChunkData() override
{
return new cIncrementalRedstoneSimulatorChunkData;
}
virtual void Simulate(float a_Dt) override { UNUSED(a_Dt);} // not used
virtual void SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, ChunkType * a_Chunk) override;

View File

@ -36,5 +36,10 @@ public:
UNUSED(a_BlockZ);
UNUSED(a_Chunk);
}
virtual cRedstoneSimulatorChunkData * CreateChunkData() override
{
return NULL;
}
} ;

View File

@ -24,5 +24,7 @@ public:
super(a_World)
{
}
virtual cRedstoneSimulatorChunkData * CreateChunkData() = 0;
} ;