![]() |
Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <DelayedFluidSimulator.h>
Public Member Functions | |
virtual void | AddBlock (Vector3i a_Block, cChunk *a_Chunk) override |
Called to simulate a new block. More... | |
cDelayedFluidSimulator (cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid, int a_TickDelay) | |
virtual cFluidSimulatorData * | CreateChunkData (void) override |
Creates a ChunkData object for the simulator to use. More... | |
virtual void | Simulate (float a_Dt) override |
Called in each tick, a_Dt is the time passed since the last tick, in msec. More... | |
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 access to chunk data available. More... | |
![]() | |
cFluidSimulator (cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid) | |
virtual Vector3f | GetFlowingDirection (int a_X, int a_Y, int a_Z) |
Returns a unit vector in the direction the fluid is flowing or a zero-vector if not flowing. More... | |
virtual bool | IsAllowedBlock (BLOCKTYPE a_BlockType) override |
Returns true if the specified block type is "interesting" for this simulator. More... | |
bool | IsAnyFluidBlock (BLOCKTYPE a_BlockType) const |
bool | IsFluidBlock (BLOCKTYPE a_BlockType) const |
bool | IsHigherMeta (NIBBLETYPE a_Meta1, NIBBLETYPE a_Meta2) |
Returns true if a_Meta1 is a higher fluid than a_Meta2. More... | |
bool | IsPassableForFluid (BLOCKTYPE a_BlockType) |
bool | IsSolidBlock (BLOCKTYPE a_BlockType) |
bool | IsStationaryFluidBlock (BLOCKTYPE a_BlockType) const |
![]() | |
cSimulator (cWorld &a_World) | |
void | WakeUp (Vector3i a_Block, cChunk *a_Chunk) |
Called when a block changes. More... | |
void | WakeUpArea (const cCuboid &a_Area) |
Does the same processing as WakeUp, but for all blocks within the specified area. More... | |
virtual | ~cSimulator () |
Protected Member Functions | |
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. More... | |
Protected Attributes | |
int | m_AddSlotNum |
int | m_SimSlotNum |
int | m_TickDelay |
int | m_TotalBlocks |
![]() | |
BLOCKTYPE | m_FluidBlock |
BLOCKTYPE | m_StationaryFluidBlock |
![]() | |
cWorld & | m_World |
Private Types | |
typedef cFluidSimulator | super |
Additional Inherited Members | |
![]() | |
static bool | CanWashAway (BLOCKTYPE a_BlockType) |
Definition at line 48 of file DelayedFluidSimulator.h.
|
private |
Definition at line 51 of file DelayedFluidSimulator.h.
cDelayedFluidSimulator::cDelayedFluidSimulator | ( | cWorld & | a_World, |
BLOCKTYPE | a_Fluid, | ||
BLOCKTYPE | a_StationaryFluid, | ||
int | a_TickDelay | ||
) |
Definition at line 68 of file DelayedFluidSimulator.cpp.
Called to simulate a new block.
Implements cSimulator.
Definition at line 81 of file DelayedFluidSimulator.cpp.
|
inlineoverridevirtual |
Creates a ChunkData object for the simulator to use.
The simulator returns the correct object type.
Reimplemented from cFluidSimulator.
Definition at line 60 of file DelayedFluidSimulator.h.
|
overridevirtual |
Called in each tick, a_Dt is the time passed since the last tick, in msec.
Implements cSimulator.
Definition at line 119 of file DelayedFluidSimulator.cpp.
|
protectedpure virtual |
Called from SimulateChunk() to simulate each block in one slot of blocks.
Descendants override this method to provide custom simulation.
Implemented in cFloodyFluidSimulator.
|
overridevirtual |
Called in each tick for each chunk, a_Dt is the time passed since the last tick, in msec; direct access to chunk data available.
Reimplemented from cSimulator.
Definition at line 133 of file DelayedFluidSimulator.cpp.
|
protected |
Definition at line 65 of file DelayedFluidSimulator.h.
|
protected |
Definition at line 66 of file DelayedFluidSimulator.h.
|
protected |
Definition at line 64 of file DelayedFluidSimulator.h.
|
protected |
Definition at line 68 of file DelayedFluidSimulator.h.