Merge pull request #1471 from mc-server/redstoneData
Use factory method to construct redstone simulator data
This commit is contained in:
commit
1422176d13
@ -92,7 +92,7 @@ cChunk::cChunk(
|
|||||||
m_NeighborZP(a_NeighborZP),
|
m_NeighborZP(a_NeighborZP),
|
||||||
m_WaterSimulatorData(a_World->GetWaterSimulator()->CreateChunkData()),
|
m_WaterSimulatorData(a_World->GetWaterSimulator()->CreateChunkData()),
|
||||||
m_LavaSimulatorData (a_World->GetLavaSimulator ()->CreateChunkData()),
|
m_LavaSimulatorData (a_World->GetLavaSimulator ()->CreateChunkData()),
|
||||||
m_RedstoneSimulatorData(NULL),
|
m_RedstoneSimulatorData(a_World->GetRedstoneSimulator()->CreateChunkData()),
|
||||||
m_AlwaysTicked(0)
|
m_AlwaysTicked(0)
|
||||||
{
|
{
|
||||||
if (a_NeighborXM != NULL)
|
if (a_NeighborXM != NULL)
|
||||||
|
@ -28,6 +28,11 @@ public:
|
|||||||
}
|
}
|
||||||
~cIncrementalRedstoneSimulator();
|
~cIncrementalRedstoneSimulator();
|
||||||
|
|
||||||
|
virtual cRedstoneSimulatorChunkData * CreateChunkData() override
|
||||||
|
{
|
||||||
|
return new cIncrementalRedstoneSimulatorChunkData;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void Simulate(float a_Dt) override { UNUSED(a_Dt);} // not used
|
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;
|
virtual void SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, ChunkType * a_Chunk) override;
|
||||||
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override { return IsRedstone(a_BlockType); }
|
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override { return IsRedstone(a_BlockType); }
|
||||||
|
@ -37,4 +37,9 @@ public:
|
|||||||
UNUSED(a_Chunk);
|
UNUSED(a_Chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual cRedstoneSimulatorChunkData * CreateChunkData() override
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
@ -25,4 +25,6 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual cRedstoneSimulatorChunkData * CreateChunkData() = 0;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user