27 for (
const auto &
Block : Blocks)
29 if (
Block.Data == Index)
35 Blocks.emplace_back(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),
109 for (
const auto &
Block : Blocks)
134 if (!Slot.
Add(a_Position.
x, a_Position.
y, a_Position.
z))
unsigned char BLOCKTYPE
The datatype used by blockdata.
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
cFluidSimulatorData * GetLavaSimulatorData(void) const
cFluidSimulatorData * GetWaterSimulatorData(void) const
static size_t MakeIndex(int x, int y, int z)
cSlot * m_Slots
Slots, one for each delay tick, each containing the blocks to simulate.
virtual ~cDelayedFluidSimulatorChunkData() override
cDelayedFluidSimulatorChunkData(int a_TickDelay)
std::vector< cCoordWithData< size_t > > m_Blocks[16]
Array of block containers, each item stores blocks for one Z coord size_t param is the block index (f...
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 AddBlock(cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) override
Called to simulate a new block.
virtual void SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk *a_Chunk) override
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.
cDelayedFluidSimulator(cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid, int a_TickDelay)
virtual void Simulate(float a_Dt) override
BLOCKTYPE m_StationaryFluidBlock