summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/Components/Tick.cpp57
-rw-r--r--tests/Components/creatable.cpp5
2 files changed, 32 insertions, 30 deletions
diff --git a/tests/Components/Tick.cpp b/tests/Components/Tick.cpp
index fac47489b..8d1fe8628 100644
--- a/tests/Components/Tick.cpp
+++ b/tests/Components/Tick.cpp
@@ -1,37 +1,38 @@
#include "Globals.h"
#include "Mobs/Components/BurningComponent.h"
+class cMockEntity
+{
+public:
+ double GetPosX () { return 0;}
+ double GetPosY () { return 0;}
+ double GetPosZ () { return 0;}
+
+ int GetChunkX () { return 0; }
+ int GetChunkZ () { return 0; }
+
+ virtual bool IsOnFire () const { return false; }
+ void StartBurning(int a_TicksLeftBurning) {}
+} Entity;
+class cMockChunk
+{
+ class cMockWorld
+ {
+ public:
+ void QueueLightChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_Callback = NULL) {}
+ virtual int GetTimeOfDay(void) const { return 0;}
+ virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) { return true; }
+ } mutable m_World;
+public:
+ bool IsLightValid(void) { return true; }
+ inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const { return 0; }
+ cMockWorld * GetWorld(void) const { return &m_World; }
+ BLOCKTYPE GetBlock (int a_BlockX, int a_BlockY, int a_BlockZ) { return 0; }
+} chunk;
int main(int argc, char** argv)
{
- class cMockEntity
- {
- public:
- double GetPosX () { return 0;}
- double GetPosY () { return 0;}
- double GetPosZ () { return 0;}
-
- int GetChunkX () { return 0; }
- int GetChunkZ () { return 0; }
-
- virtual bool IsOnFire () const { return false; }
- void StartBurning(int a_TicksLeftBurning) {}
- } Entity;
- class cMockChunk
- {
- class cMockWorld
- {
- public:
- void QueueLightChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_Callback = NULL) {}
- virtual int GetTimeOfDay(void) const { return 0;}
- virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) { return true; }
- } mutable m_World;
- public:
- bool IsLightValid(void) { return true; }
- inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const { return 0; }
- cMockWorld * GetWorld(void) const { return &m_World; }
- BLOCKTYPE GetBlock (int a_BlockX, int a_BlockY, int a_BlockZ) { return 0; }
- } chunk;
+
cBurningComponent<cMockEntity, cMockChunk> component(Entity);
component.Tick(1.0f/20.0f, chunk);
diff --git a/tests/Components/creatable.cpp b/tests/Components/creatable.cpp
index bf96720c6..9041fd427 100644
--- a/tests/Components/creatable.cpp
+++ b/tests/Components/creatable.cpp
@@ -2,10 +2,11 @@
#include "Globals.h"
#include "Mobs/Components/BurningComponent.h"
+class cMockEntity {} Entity;
+class cMockChunk {};
int main(int argc, char** argv)
{
- class cMockEntity {} Entity;
- class cMockChunk {};
+
cBurningComponent<cMockEntity, cMockChunk> component(Entity);
return 0;
}