summaryrefslogtreecommitdiffstats
path: root/source/Simulator/DelayedFluidSimulator.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-20 21:45:52 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-20 21:45:52 +0100
commite8aa03f8df037f60e4f9e6a34ac05f21bfe3c2cd (patch)
treef5a28d82586bf69532ae1ef293c7c6224f0b6ca9 /source/Simulator/DelayedFluidSimulator.h
parentHeiGenBiomal: added a fast but ugly-looking optimization, disabled by default. (diff)
downloadcuberite-e8aa03f8df037f60e4f9e6a34ac05f21bfe3c2cd.tar
cuberite-e8aa03f8df037f60e4f9e6a34ac05f21bfe3c2cd.tar.gz
cuberite-e8aa03f8df037f60e4f9e6a34ac05f21bfe3c2cd.tar.bz2
cuberite-e8aa03f8df037f60e4f9e6a34ac05f21bfe3c2cd.tar.lz
cuberite-e8aa03f8df037f60e4f9e6a34ac05f21bfe3c2cd.tar.xz
cuberite-e8aa03f8df037f60e4f9e6a34ac05f21bfe3c2cd.tar.zst
cuberite-e8aa03f8df037f60e4f9e6a34ac05f21bfe3c2cd.zip
Diffstat (limited to 'source/Simulator/DelayedFluidSimulator.h')
-rw-r--r--source/Simulator/DelayedFluidSimulator.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/source/Simulator/DelayedFluidSimulator.h b/source/Simulator/DelayedFluidSimulator.h
index 5f8c6e073..6f7433877 100644
--- a/source/Simulator/DelayedFluidSimulator.h
+++ b/source/Simulator/DelayedFluidSimulator.h
@@ -19,13 +19,26 @@ class cDelayedFluidSimulatorChunkData :
public cFluidSimulatorData
{
public:
+ class cSlot
+ {
+ public:
+ /// Returns true if the specified block is stored
+ bool HasBlock(int a_RelX, int a_RelY, int a_RelZ);
+
+ /// Adds the specified block unless already present; returns true if added, false if the block was already present
+ bool Add(int a_RelX, int a_RelY, int a_RelZ);
+
+ /** Array of block containers, each item stores blocks for one Z coord
+ Int param is the block index (for faster duplicate comparison in Add())
+ */
+ cCoordWithIntVector m_Blocks[16];
+ } ;
+
cDelayedFluidSimulatorChunkData(int a_TickDelay);
virtual ~cDelayedFluidSimulatorChunkData();
- /** Slots, one for each delay tick, each containing the blocks to simulate; relative coords.
- Int param is the block index (for faster duplicate comparison in cDelayedFluidSimulator::AddBlock())
- */
- cCoordWithIntVector * m_Slots;
+ /// Slots, one for each delay tick, each containing the blocks to simulate
+ cSlot * m_Slots;
} ;