26 bool HasBlock(
int a_RelX,
int a_RelY,
int a_RelZ);
29 bool Add(
int a_RelX,
int a_RelY,
int a_RelZ);
34 std::vector<cCoordWithData<size_t>>
m_Blocks[16];
59 virtual void Simulate(
float a_Dt)
override;
60 virtual void SimulateChunk(std::chrono::milliseconds a_Dt,
int a_ChunkX,
int a_ChunkZ,
cChunk * a_Chunk)
override;
unsigned char BLOCKTYPE
The datatype used by blockdata.
cSlot * m_Slots
Slots, one for each delay tick, each containing the blocks to simulate.
virtual ~cDelayedFluidSimulatorChunkData() override
cDelayedFluidSimulatorChunkData(int a_TickDelay)
bool HasBlock(int a_RelX, int a_RelY, int a_RelZ)
Returns true if the specified block is stored.
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
virtual cFluidSimulatorData * CreateChunkData(void) override
Creates a ChunkData object for the simulator to use.
This is a base class for all fluid simulator data classes.
cFluidSimulator(cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid)