summaryrefslogtreecommitdiffstats
path: root/src/Simulator/DelayedFluidSimulator.h
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
commit6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch)
tree7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/Simulator/DelayedFluidSimulator.h
parentMerge pull request #2958 from LogicParrot/fence (diff)
parentBulk clearing of whitespace (diff)
downloadcuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip
Diffstat (limited to 'src/Simulator/DelayedFluidSimulator.h')
-rw-r--r--src/Simulator/DelayedFluidSimulator.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Simulator/DelayedFluidSimulator.h b/src/Simulator/DelayedFluidSimulator.h
index 05f70e2fd..62efb717e 100644
--- a/src/Simulator/DelayedFluidSimulator.h
+++ b/src/Simulator/DelayedFluidSimulator.h
@@ -24,19 +24,19 @@ public:
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 */
cSlot * m_Slots;
} ;
@@ -52,25 +52,25 @@ class cDelayedFluidSimulator :
public:
cDelayedFluidSimulator(cWorld & a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid, int a_TickDelay);
-
+
// cSimulator overrides:
virtual void AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) override;
virtual void Simulate(float a_Dt) override;
virtual void SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk * a_Chunk) override;
virtual cFluidSimulatorData * CreateChunkData(void) override { return new cDelayedFluidSimulatorChunkData(m_TickDelay); }
-
+
protected:
int m_TickDelay; // Count of the m_Slots array in each ChunkData
int m_AddSlotNum; // Index into m_Slots[] where to add new blocks in each ChunkData
int m_SimSlotNum; // Index into m_Slots[] where to simulate blocks in each ChunkData
-
+
int m_TotalBlocks; // Statistics only: the total number of blocks currently queued
/* Slots:
| 0 | 1 | ... | m_AddSlotNum | m_SimSlotNum | ... | m_TickDelay - 1 |
| adding blocks here ^ | ^ simulating here */
-
+
/** Called from SimulateChunk() to simulate each block in one slot of blocks. Descendants override this method to provide custom simulation. */
virtual void SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ) = 0;
} ;