From 176664810b43a839d92418b2558359e61b700935 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Fri, 7 Feb 2014 22:13:55 +0100 Subject: Implemented an easy way of adding new redstone simulators. Also added a "noop" redstone simulator that does the same as the fluid version. --- src/Simulator/NoopRedstoneSimulator.h | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/Simulator/NoopRedstoneSimulator.h (limited to 'src/Simulator/NoopRedstoneSimulator.h') diff --git a/src/Simulator/NoopRedstoneSimulator.h b/src/Simulator/NoopRedstoneSimulator.h new file mode 100644 index 000000000..4dd473c64 --- /dev/null +++ b/src/Simulator/NoopRedstoneSimulator.h @@ -0,0 +1,40 @@ + +#pragma once + +#include "RedstoneManager.h" + + + + + +class cRedstoneNoopSimulator : + public cRedstoneManager +{ + typedef cRedstoneManager super; +public: + + cRedstoneNoopSimulator(cWorld & a_World) : + super(a_World) + { + } + + //~cRedstoneNoopSimulator(); + + virtual void Simulate(float a_Dt) override { UNUSED(a_Dt);} // not used + virtual void SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChunk * a_Chunk) override + { + UNUSED(a_Dt); + UNUSED(a_ChunkX); + UNUSED(a_ChunkZ); + UNUSED(a_Chunk); + } + virtual bool IsAllowedBlock( BLOCKTYPE a_BlockType ) override { return false; } + virtual void AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) override + { + UNUSED(a_BlockX); + UNUSED(a_BlockY); + UNUSED(a_BlockZ); + UNUSED(a_Chunk); + } + +} ; \ No newline at end of file -- cgit v1.2.3 From 09a23fa11473d0cad74985d8cd8ecdcddef46b45 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Fri, 7 Feb 2014 22:25:15 +0100 Subject: Fixed some end of lines --- src/Simulator/NoopRedstoneSimulator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Simulator/NoopRedstoneSimulator.h') diff --git a/src/Simulator/NoopRedstoneSimulator.h b/src/Simulator/NoopRedstoneSimulator.h index 4dd473c64..d2e00d039 100644 --- a/src/Simulator/NoopRedstoneSimulator.h +++ b/src/Simulator/NoopRedstoneSimulator.h @@ -37,4 +37,4 @@ public: UNUSED(a_Chunk); } -} ; \ No newline at end of file +} ; -- cgit v1.2.3 From 3a897844a0796ce91e51e0154acbbce2d8e807e5 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Fri, 7 Feb 2014 22:59:08 +0100 Subject: Renamed cRedstoneManager to cRedstoneSimulator and renamed cRedstoneSimulator to cIncrementalRedstoneSimulator (Might change later). --- src/Simulator/NoopRedstoneSimulator.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Simulator/NoopRedstoneSimulator.h') diff --git a/src/Simulator/NoopRedstoneSimulator.h b/src/Simulator/NoopRedstoneSimulator.h index d2e00d039..fe3949198 100644 --- a/src/Simulator/NoopRedstoneSimulator.h +++ b/src/Simulator/NoopRedstoneSimulator.h @@ -1,16 +1,16 @@ #pragma once -#include "RedstoneManager.h" +#include "RedstoneSimulator.h" class cRedstoneNoopSimulator : - public cRedstoneManager + public cRedstoneSimulator { - typedef cRedstoneManager super; + typedef cRedstoneSimulator super; public: cRedstoneNoopSimulator(cWorld & a_World) : -- cgit v1.2.3