summaryrefslogtreecommitdiffstats
path: root/source/Simulator/DelayedFluidSimulator.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-14 19:06:21 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-14 19:06:21 +0200
commit5b7de82a79e3f18affcffd686484a681d187942a (patch)
tree3a0b766fd827de634456bee9ea9ce225f40bfb60 /source/Simulator/DelayedFluidSimulator.h
parentBiomal CompoGen now generates sea with STATIONARY_WATER instead of regular WATER. (diff)
downloadcuberite-5b7de82a79e3f18affcffd686484a681d187942a.tar
cuberite-5b7de82a79e3f18affcffd686484a681d187942a.tar.gz
cuberite-5b7de82a79e3f18affcffd686484a681d187942a.tar.bz2
cuberite-5b7de82a79e3f18affcffd686484a681d187942a.tar.lz
cuberite-5b7de82a79e3f18affcffd686484a681d187942a.tar.xz
cuberite-5b7de82a79e3f18affcffd686484a681d187942a.tar.zst
cuberite-5b7de82a79e3f18affcffd686484a681d187942a.zip
Diffstat (limited to '')
-rw-r--r--source/Simulator/DelayedFluidSimulator.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/source/Simulator/DelayedFluidSimulator.h b/source/Simulator/DelayedFluidSimulator.h
new file mode 100644
index 000000000..b9c180580
--- /dev/null
+++ b/source/Simulator/DelayedFluidSimulator.h
@@ -0,0 +1,44 @@
+
+// DelayedFluidSimulator.h
+
+// Interfaces to the cDelayedFluidSimulator class representing a fluid simulator that has a configurable delay
+// before simulating a block. Each tick it takes a consecutive delay "slot" and simulates only blocks in that slot.
+
+
+
+
+#pragma once
+
+#include "FluidSimulator.h"
+
+
+
+
+
+class cDelayedFluidSimulator :
+ public cFluidSimulator
+{
+ typedef cFluidSimulator super;
+
+public:
+ cDelayedFluidSimulator(cWorld * a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid, int a_TickDelay);
+ virtual ~cDelayedFluidSimulator();
+
+ // cSimulator overrides:
+ virtual void AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ) override;
+ virtual void Simulate(float a_Dt) override;
+
+protected:
+ typedef std::vector<Vector3i> CoordsArray;
+
+ int m_TickDelay; // Count of the m_Slots array
+ CoordsArray * m_Slots; // Slots, one for each delay tick
+ int m_CurrentSlotNum; // Index into m_Slots[] where to insert new blocks
+
+ /// Called from Simulate() to simulate each block in one slot of blocks. Descendants override this method to provide custom simulation.
+ virtual void SimulateBlock(int a_BlockX, int a_BlockY, int a_BlockZ) = 0;
+} ;
+
+
+
+