Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <FluidSimulator.h>
Public Member Functions | |
cFluidSimulator (cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid) | |
virtual cFluidSimulatorData * | CreateChunkData (void)=0 |
Creates a ChunkData object for the simulator to use. More... | |
virtual Vector3f | GetFlowingDirection (Vector3i a_Pos) |
Returns a unit vector in the direction the fluid is flowing or a zero-vector if not flowing. 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 |
Public Member Functions inherited from cSimulator | |
cSimulator (cWorld &a_World) | |
virtual | ~cSimulator () |
Static Public Member Functions | |
static bool | CanWashAway (BLOCKTYPE a_BlockType) |
Static Public Member Functions inherited from cSimulator | |
static std::array< Vector3i, 5 > | GetLinkedOffsets (Vector3i Offset) |
For a given offset from a position, return the offsets that represent the adjacents of the newly offset position, excluding the old position. More... | |
Protected Member Functions | |
bool | IsAllowedBlock (BLOCKTYPE a_BlockType) |
Protected Member Functions inherited from cSimulator | |
virtual void | AddBlock (cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block)=0 |
Called to simulate a new block. More... | |
virtual void | Simulate (float a_Dt) |
virtual void | SimulateChunk (std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk *a_Chunk)=0 |
virtual void | WakeUp (cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) |
Called to simulate a single new block, typically as a result of a single block break or change. More... | |
virtual void | WakeUp (cChunk &a_Chunk, Vector3i a_Position, Vector3i a_Offset, BLOCKTYPE a_Block) |
Called to simulate a single block, synthesised by the simulator manager. More... | |
Protected Attributes | |
BLOCKTYPE | m_FluidBlock |
BLOCKTYPE | m_StationaryFluidBlock |
Protected Attributes inherited from cSimulator | |
cWorld & | m_World |
Private Types | |
using | Super = cSimulator |
Additional Inherited Members | |
Static Public Attributes inherited from cSimulator | |
static constexpr std::array< Vector3i, 6 > | AdjacentOffsets |
Contains offsets for direct adjacents of any position. More... | |
Definition at line 37 of file FluidSimulator.h.
|
private |
Definition at line 40 of file FluidSimulator.h.
cFluidSimulator::cFluidSimulator | ( | cWorld & | a_World, |
BLOCKTYPE | a_Fluid, | ||
BLOCKTYPE | a_StationaryFluid | ||
) |
Definition at line 10 of file FluidSimulator.cpp.
|
static |
Definition at line 30 of file FluidSimulator.cpp.
|
pure virtual |
Creates a ChunkData object for the simulator to use.
The simulator returns the correct object type.
Implemented in cVaporizeFluidSimulator, cNoopFluidSimulator, and cDelayedFluidSimulator.
Returns a unit vector in the direction the fluid is flowing or a zero-vector if not flowing.
Definition at line 133 of file FluidSimulator.cpp.
|
protected |
Definition at line 21 of file FluidSimulator.cpp.
|
inline |
Definition at line 54 of file FluidSimulator.h.
|
inline |
Definition at line 52 of file FluidSimulator.h.
bool cFluidSimulator::IsHigherMeta | ( | NIBBLETYPE | a_Meta1, |
NIBBLETYPE | a_Meta2 | ||
) |
Returns true if a_Meta1 is a higher fluid than a_Meta2.
Takes source blocks into account.
Definition at line 101 of file FluidSimulator.cpp.
bool cFluidSimulator::IsPassableForFluid | ( | BLOCKTYPE | a_BlockType | ) |
Definition at line 87 of file FluidSimulator.cpp.
bool cFluidSimulator::IsSolidBlock | ( | BLOCKTYPE | a_BlockType | ) |
Definition at line 78 of file FluidSimulator.cpp.
|
inline |
Definition at line 53 of file FluidSimulator.h.
|
protected |
Definition at line 68 of file FluidSimulator.h.
|
protected |
Definition at line 69 of file FluidSimulator.h.