summaryrefslogtreecommitdiffstats
path: root/source/Simulator/FluidSimulator.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/Simulator/FluidSimulator.h')
-rw-r--r--source/Simulator/FluidSimulator.h16
1 files changed, 16 insertions, 0 deletions
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)); }