From d8c8d0124da12587bbaf52992f7a8d2e0b010544 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 20 Aug 2020 20:04:28 +0100 Subject: Replace PowerData struct with PowerLevel * We no longer need to track the powering block with the removal of SolidBlockHandler. PowerLevel is now just an unsigned char --- .../IncrementalRedstoneSimulator/RedstoneWireHandler.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h') diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h b/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h index bbc1c212d..2e04b4b75 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h +++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h @@ -189,7 +189,7 @@ namespace RedstoneWireHandler DataForChunk(Chunk).WireStates[Position] = Block; } - inline unsigned char GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) + inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) { // Starts off as the wire's meta value, modified appropriately and returned auto Power = a_Chunk.GetMeta(a_Position); @@ -253,16 +253,16 @@ namespace RedstoneWireHandler return Power; } - inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, PoweringData a_PoweringData) + inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) { - // LOGD("Evaluating dusty the wire (%d %d %d) %i", a_Position.x, a_Position.y, a_Position.z, a_PoweringData.PowerLevel); + // LOGD("Evaluating dusty the wire (%d %d %d) %i", a_Position.x, a_Position.y, a_Position.z, Power); - if (a_Meta == a_PoweringData.PowerLevel) + if (a_Meta == Power) { return; } - a_Chunk.SetMeta(a_Position, a_PoweringData.PowerLevel); + a_Chunk.SetMeta(a_Position, Power); // Notify all positions, sans YP, to update: for (const auto Offset : RelativeAdjacents) -- cgit v1.2.3