Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Types | List of all members
cFluidSimulator Class Reference

#include <FluidSimulator.h>

Inheritance diagram for cFluidSimulator:
Inheritance graph
[legend]
Collaboration diagram for cFluidSimulator:
Collaboration graph
[legend]

Public Member Functions

 cFluidSimulator (cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid)
 
virtual cFluidSimulatorDataCreateChunkData (void)
 Creates a ChunkData object for the simulator to use. More...
 
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
 
- Public Member Functions inherited from cSimulator
 cSimulator (cWorld &a_World)
 
virtual void Simulate (float a_Dt)=0
 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)
 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...
 
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 ()
 

Static Public Member Functions

static bool CanWashAway (BLOCKTYPE a_BlockType)
 

Protected Attributes

BLOCKTYPE m_FluidBlock
 
BLOCKTYPE m_StationaryFluidBlock
 
- Protected Attributes inherited from cSimulator
cWorldm_World
 

Private Types

typedef cSimulator super
 

Additional Inherited Members

- Protected Member Functions inherited from cSimulator
virtual void AddBlock (Vector3i a_Block, cChunk *a_Chunk)=0
 Called to simulate a new block. More...
 

Detailed Description

Definition at line 37 of file FluidSimulator.h.

Member Typedef Documentation

Definition at line 40 of file FluidSimulator.h.

Constructor & Destructor Documentation

cFluidSimulator::cFluidSimulator ( cWorld a_World,
BLOCKTYPE  a_Fluid,
BLOCKTYPE  a_StationaryFluid 
)

Definition at line 10 of file FluidSimulator.cpp.

Member Function Documentation

bool cFluidSimulator::CanWashAway ( BLOCKTYPE  a_BlockType)
static

Definition at line 30 of file FluidSimulator.cpp.

virtual cFluidSimulatorData* cFluidSimulator::CreateChunkData ( void  )
inlinevirtual

Creates a ChunkData object for the simulator to use.

The simulator returns the correct object type.

Reimplemented in cDelayedFluidSimulator.

Definition at line 52 of file FluidSimulator.h.

Vector3f cFluidSimulator::GetFlowingDirection ( int  a_X,
int  a_Y,
int  a_Z 
)
virtual

Returns a unit vector in the direction the fluid is flowing or a zero-vector if not flowing.

Definition at line 131 of file FluidSimulator.cpp.

bool cFluidSimulator::IsAllowedBlock ( BLOCKTYPE  a_BlockType)
overridevirtual

Returns true if the specified block type is "interesting" for this simulator.

Implements cSimulator.

Definition at line 21 of file FluidSimulator.cpp.

bool cFluidSimulator::IsAnyFluidBlock ( BLOCKTYPE  a_BlockType) const
inline

Definition at line 56 of file FluidSimulator.h.

bool cFluidSimulator::IsFluidBlock ( BLOCKTYPE  a_BlockType) const
inline

Definition at line 54 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 99 of file FluidSimulator.cpp.

bool cFluidSimulator::IsPassableForFluid ( BLOCKTYPE  a_BlockType)

Definition at line 85 of file FluidSimulator.cpp.

bool cFluidSimulator::IsSolidBlock ( BLOCKTYPE  a_BlockType)

Definition at line 76 of file FluidSimulator.cpp.

bool cFluidSimulator::IsStationaryFluidBlock ( BLOCKTYPE  a_BlockType) const
inline

Definition at line 55 of file FluidSimulator.h.

Member Data Documentation

BLOCKTYPE cFluidSimulator::m_FluidBlock
protected

Definition at line 67 of file FluidSimulator.h.

BLOCKTYPE cFluidSimulator::m_StationaryFluidBlock
protected

Definition at line 68 of file FluidSimulator.h.


The documentation for this class was generated from the following files: