diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-10-13 11:53:28 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-10-13 11:53:28 +0200 |
commit | f7da7c2536b438db92bc28b88c4139d9af15e44f (patch) | |
tree | 4710e9e41ebcf2317ebacade2801732ba9184b41 /source/Simulator/FireSimulator.cpp | |
parent | ProtoProxy: Fixed parsing of the PACKET_PLAYER_ABILITIES packet. (diff) | |
download | cuberite-f7da7c2536b438db92bc28b88c4139d9af15e44f.tar cuberite-f7da7c2536b438db92bc28b88c4139d9af15e44f.tar.gz cuberite-f7da7c2536b438db92bc28b88c4139d9af15e44f.tar.bz2 cuberite-f7da7c2536b438db92bc28b88c4139d9af15e44f.tar.lz cuberite-f7da7c2536b438db92bc28b88c4139d9af15e44f.tar.xz cuberite-f7da7c2536b438db92bc28b88c4139d9af15e44f.tar.zst cuberite-f7da7c2536b438db92bc28b88c4139d9af15e44f.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Simulator/FireSimulator.cpp (renamed from source/FireSimulator.cpp) | 57 |
1 files changed, 51 insertions, 6 deletions
diff --git a/source/FireSimulator.cpp b/source/Simulator/FireSimulator.cpp index 1dc104d0c..c2f22668b 100644 --- a/source/FireSimulator.cpp +++ b/source/Simulator/FireSimulator.cpp @@ -2,10 +2,13 @@ #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "FireSimulator.h" -#include "World.h" -#include "Vector3i.h" -#include "BlockID.h" -#include "Defines.h" +#include "../World.h" +#include "../BlockID.h" +#include "../Defines.h" + + + + cFireSimulator::cFireSimulator( cWorld* a_World ) : cSimulator(a_World) @@ -13,9 +16,12 @@ cFireSimulator::cFireSimulator( cWorld* a_World ) , m_Buffer(new BlockList) , m_BurningBlocks(new BlockList) { - } + + + + cFireSimulator::~cFireSimulator() { delete m_Buffer; @@ -23,6 +29,10 @@ cFireSimulator::~cFireSimulator() delete m_BurningBlocks; } + + + + void cFireSimulator::Simulate( float a_Dt ) { m_Buffer->clear(); @@ -48,12 +58,19 @@ void cFireSimulator::Simulate( float a_Dt ) } + + + bool cFireSimulator::IsAllowedBlock( BLOCKTYPE a_BlockType ) { return a_BlockType == E_BLOCK_FIRE || IsBlockLava(a_BlockType); } + + + + void cFireSimulator::AddBlock(int a_X, int a_Y, int a_Z) { char BlockID = m_World->GetBlock(a_X, a_Y, a_Z); @@ -72,17 +89,29 @@ void cFireSimulator::AddBlock(int a_X, int a_Y, int a_Z) } + + + + void cFireSimulator::_AddBlock(int a_X, int a_Y, int a_Z) { m_Blocks->push_back( Vector3i(a_X, a_Y, a_Z) ); } + + + + bool cFireSimulator::IsForeverBurnable( BLOCKTYPE a_BlockType ) { return a_BlockType == E_BLOCK_BLOODSTONE; } + + + + bool cFireSimulator::IsBurnable( BLOCKTYPE a_BlockType ) { return a_BlockType == E_BLOCK_PLANKS @@ -95,11 +124,19 @@ bool cFireSimulator::IsBurnable( BLOCKTYPE a_BlockType ) || a_BlockType == E_BLOCK_VINES; } + + + + bool cFireSimulator::FiresForever( BLOCKTYPE a_BlockType ) { return a_BlockType != E_BLOCK_FIRE; } + + + + bool cFireSimulator::BurnBlockAround(int a_X, int a_Y, int a_Z) { return BurnBlock(a_X + 1, a_Y, a_Z) @@ -110,6 +147,10 @@ bool cFireSimulator::BurnBlockAround(int a_X, int a_Y, int a_Z) || BurnBlock(a_X, a_Y, a_Z - 1); } + + + + bool cFireSimulator::BurnBlock(int a_X, int a_Y, int a_Z) { char BlockID = m_World->GetBlock(a_X, a_Y, a_Z); @@ -130,4 +171,8 @@ bool cFireSimulator::BurnBlock(int a_X, int a_Y, int a_Z) } return false; -}
\ No newline at end of file +} + + + + |