5 #include "../IniFile.h"
30 virtual void SimulateChunk(std::chrono::milliseconds a_Dt,
int a_ChunkX,
int a_ChunkZ,
cChunk * a_Chunk)
override;
std::list< cCoordWithInt > cCoordWithIntList
unsigned char BLOCKTYPE
The datatype used by blockdata.
cCoordWithIntList cFireSimulatorChunkData
Stores individual fire blocks in the chunk; the int data is used as the time [msec] the fire takes to...
The fire simulator takes care of the fire blocks.
unsigned m_BurnStepTimeNonfuel
Time (in msec) that a fire block takes to burn without a fuel block into the next step.
void RemoveFuelNeighbors(cChunk *a_Chunk, Vector3i a_RelPos)
Removes all burnable blocks neighboring the specified block.
int m_ReplaceFuelChance
Chance [0..100000] of a fuel burning out being replaced by a new fire block instead of an air block.
static bool IsFuel(BLOCKTYPE a_BlockType)
bool CanStartFireInBlock(cChunk *a_NearChunk, Vector3i a_RelPos)
Returns true if a fire can be started in the specified block, that is, it is an air block and has fue...
static bool IsAllowedBlock(BLOCKTYPE a_BlockType)
int m_Flammability
Chance [0..100000] of an adjacent fuel to catch fire on each tick.
virtual void AddBlock(cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) override
Called to simulate a new block.
void TrySpreadFire(cChunk *a_Chunk, Vector3i a_RelPos)
Tries to spread fire to a neighborhood of the specified block.
virtual void SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk *a_Chunk) override
unsigned m_BurnStepTimeFuel
Time (in msec) that a fire block takes to burn with a fuel block into the next step.
cFireSimulator(cWorld &a_World, cIniFile &a_IniFile)
int GetBurnStepTime(cChunk *a_Chunk, Vector3i a_RelPos)
Returns the time [msec] after which the specified fire block is stepped again; based on surrounding f...
static bool DoesBurnForever(BLOCKTYPE a_BlockType)
Base class for all block-based physics simulators (such as fluid, fire, falling blocks etc....