25 virtual void SimulateChunk(std::chrono::milliseconds a_Dt,
int a_ChunkX,
int a_ChunkZ,
cChunk * a_Chunk)
override;
virtual void AddBlock(Vector3i a_Block, cChunk *a_Chunk) override
Called to simulate a new block.
unsigned char BLOCKTYPE
The datatype used by blockdata.
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...
virtual ~cFireSimulator() override
static bool DoesBurnForever(BLOCKTYPE a_BlockType)
int m_Flammability
Chance [0..100000] of an adjacent fuel to catch fire on each tick.
virtual void Simulate(float a_Dt) override
Called in each tick, a_Dt is the time passed since the last tick, in msec.
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...
Base class for all block-based physics simulators (such as fluid, fire, falling blocks etc...
int m_ReplaceFuelChance
Chance [0..100000] of a fuel burning out being replaced by a new fire block instead of an air block...
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override
Returns true if the specified block type is "interesting" for this simulator.
cCoordWithIntList cFireSimulatorChunkData
Stores individual fire blocks in the chunk; the int data is used as the time [msec] the fire takes to...
std::list< cCoordWithInt > cCoordWithIntList
void RemoveFuelNeighbors(cChunk *a_Chunk, Vector3i a_RelPos)
Removes all burnable blocks neighboring the specified block.
cFireSimulator(cWorld &a_World, cIniFile &a_IniFile)
unsigned m_BurnStepTimeFuel
Time (in msec) that a fire block takes to burn with a fuel block into the next step.
The fire simulator takes care of the fire blocks.
void TrySpreadFire(cChunk *a_Chunk, Vector3i a_RelPos)
Tries to spread fire to a neighborhood of the specified block.
unsigned m_BurnStepTimeNonfuel
Time (in msec) that a fire block takes to burn without a fuel block into the next step...
virtual void SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk *a_Chunk) override
Called in each tick for each chunk, a_Dt is the time passed since the last tick, in msec; direct acce...
static bool IsFuel(BLOCKTYPE a_BlockType)