Cuberite
A lightweight, fast and extensible game server for Minecraft
NoopFluidSimulator.h
Go to the documentation of this file.
1 
2 // NoopFluidSimulator.h
3 
4 // Declares the cNoopFluidSimulator class representing a fluid simulator that performs nothing, it ignores all blocks
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "FluidSimulator.h"
13 
14 
15 
16 
17 
18 class cNoopFluidSimulator final :
19  public cFluidSimulator
20 {
22 
23 public:
24 
25  using Super::Super;
26 
27 private:
28 
29  virtual void SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk * a_Chunk) override
30  {
31  UNUSED(a_Dt);
32  UNUSED(a_ChunkX);
33  UNUSED(a_ChunkZ);
34  UNUSED(a_Chunk);
35  }
36 
37  virtual void AddBlock(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) override
38  {
39  UNUSED(a_Block);
40  UNUSED(a_Chunk);
41  }
42 
43  virtual cFluidSimulatorData * CreateChunkData(void) override { return nullptr; }
44 } ;
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:41
#define UNUSED
Definition: Globals.h:72
Definition: Chunk.h:36
This is a base class for all fluid simulator data classes.
cFluidSimulator(cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid)
cSimulator Super
virtual void SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk *a_Chunk) override
virtual void AddBlock(cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) override
Called to simulate a new block.
virtual cFluidSimulatorData * CreateChunkData(void) override
Creates a ChunkData object for the simulator to use.
Base class for all block-based physics simulators (such as fluid, fire, falling blocks etc....
Definition: Simulator.h:22