summaryrefslogtreecommitdiffstats
path: root/source/Simulator/FireSimulator.cpp
diff options
context:
space:
mode:
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
+}
+
+
+
+