Floody fluid simulator has been converted to use direct chunk access

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1236 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-03-02 15:44:31 +00:00
parent 476cd25ade
commit 66670f5d5c
7 changed files with 236 additions and 142 deletions
+16
View File
@@ -22,6 +22,19 @@ enum Direction
/** This is a base class for all fluid simulator data classes.
Needed so that cChunk can properly delete instances of fluid simulator data, no matter what simulator it's using
*/
class cFluidSimulatorData
{
public:
virtual ~cFluidSimulatorData() {}
} ;
class cFluidSimulator :
public cSimulator
{
@@ -36,6 +49,9 @@ public:
/// Gets the flowing direction. If a_Over is true also the block over the current block affects the direction (standard)
virtual Direction GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a_Over = true);
/// Creates a ChunkData object for the simulator to use. The simulator returns the correct object type.
virtual cFluidSimulatorData * CreateChunkData(void) { return NULL; }
bool IsFluidBlock (BLOCKTYPE a_BlockType) const { return (a_BlockType == m_FluidBlock); }
bool IsStationaryFluidBlock(BLOCKTYPE a_BlockType) const { return (a_BlockType == m_StationaryFluidBlock); }
bool IsAnyFluidBlock (BLOCKTYPE a_BlockType) const { return ((a_BlockType == m_FluidBlock) || (a_BlockType == m_StationaryFluidBlock)); }