From 66670f5d5ccabb3b560c2342d79d0cb1e8550899 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 2 Mar 2013 15:44:31 +0000 Subject: 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 --- source/Simulator/FluidSimulator.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/Simulator/FluidSimulator.h') diff --git a/source/Simulator/FluidSimulator.h b/source/Simulator/FluidSimulator.h index fce18522f..672b740a2 100644 --- a/source/Simulator/FluidSimulator.h +++ b/source/Simulator/FluidSimulator.h @@ -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)); } -- cgit v1.2.3