27 for (cCoordWithIntVector::const_iterator itr = Blocks.begin(), end = Blocks.end(); itr != end; ++itr)
29 if (itr->Data == Index)
35 Blocks.push_back(
cCoordWithInt(a_RelX, a_RelY, a_RelZ, Index));
69 super(a_World, a_Fluid, a_StationaryFluid),
70 m_TickDelay(a_TickDelay),
71 m_AddSlotNum(a_TickDelay - 1),
89 if ((a_Chunk ==
nullptr) || !a_Chunk->
IsValid())
107 if (!Slot.
Add(RelX, a_Block.
y, RelZ))
147 for (cCoordWithIntVector::iterator itr = Blocks.begin(), end = Blocks.end(); itr != end; ++itr)
bool IsValid(void) const
Returns true iff the chunk block data is valid (loaded / generated)
unsigned char BLOCKTYPE
The datatype used by blockdata.
virtual void SimulateBlock(cChunk *a_Chunk, int a_RelX, int a_RelY, int a_RelZ)=0
Called from SimulateChunk() to simulate each block in one slot of blocks.
cDelayedFluidSimulatorChunkData(int a_TickDelay)
virtual void Simulate(float a_Dt) override
Called in each tick, a_Dt is the time passed since the last tick, in msec.
cFluidSimulatorData * GetLavaSimulatorData(void)
static int MakeIndexNoCheck(int x, int y, int z)
cSlot * m_Slots
Slots, one for each delay tick, each containing the blocks to simulate.
virtual void AddBlock(Vector3i a_Block, cChunk *a_Chunk) override
Called to simulate a new block.
bool Add(int a_RelX, int a_RelY, int a_RelZ)
Adds the specified block unless already present; returns true if added, false if the block was alread...
virtual void SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk *a_Chunk) override
Called in each tick for each chunk, a_Dt is the time passed since the last tick, in msec; direct acce...
BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const
cCoordWithIntVector m_Blocks[16]
Array of block containers, each item stores blocks for one Z coord Int param is the block index (for ...
std::vector< cCoordWithInt > cCoordWithIntVector
virtual ~cDelayedFluidSimulatorChunkData()
cFluidSimulatorData * GetWaterSimulatorData(void)
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
cDelayedFluidSimulator(cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid, int a_TickDelay)
cCoordWithData< int > cCoordWithInt