From 3143d6ce679f322ee73d3d70e2d843e9c98cc043 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 19 Aug 2020 21:14:40 +0100 Subject: Remove std::make_unique from redstone handler creation --- .../IncrementalRedstoneSimulator/PoweredRailHandler.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/Simulator/IncrementalRedstoneSimulator/PoweredRailHandler.h') diff --git a/src/Simulator/IncrementalRedstoneSimulator/PoweredRailHandler.h b/src/Simulator/IncrementalRedstoneSimulator/PoweredRailHandler.h index 6f8dbc196..c420251b1 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/PoweredRailHandler.h +++ b/src/Simulator/IncrementalRedstoneSimulator/PoweredRailHandler.h @@ -1,15 +1,13 @@ #pragma once -#include "RedstoneHandler.h" - -class cPoweredRailHandler final : public cRedstoneHandler +namespace PoweredRailHandler { - static Vector3i GetPoweredRailAdjacentXZCoordinateOffset(NIBBLETYPE a_Meta) // Not in cBlockRailHandler since specific to powered rails + Vector3i GetPoweredRailAdjacentXZCoordinateOffset(NIBBLETYPE a_Meta) // Not in cBlockRailHandler since specific to powered rails { switch (a_Meta & 0x7) { @@ -27,7 +25,7 @@ class cPoweredRailHandler final : public cRedstoneHandler } } - virtual unsigned char GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) const override + inline unsigned char GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) { UNUSED(a_QueryBlockType); @@ -41,7 +39,7 @@ class cPoweredRailHandler final : public cRedstoneHandler return 0; } - virtual void Update(cChunk & a_Chunk, cChunk & CurrentlyTickingChunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, PoweringData a_PoweringData) const override + inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTickingChunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, PoweringData a_PoweringData) { // LOGD("Evaluating tracky the rail (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); @@ -78,7 +76,7 @@ class cPoweredRailHandler final : public cRedstoneHandler } } - virtual void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, SourceCallback Callback) const override + inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) { UNUSED(a_Chunk); UNUSED(a_Meta); -- cgit v1.2.3