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/RedstoneHandler.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp') diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp b/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp index c5457e302..dc2c690f9 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp @@ -87,7 +87,7 @@ namespace RedstoneHandler { - unsigned char GetPowerDeliveredToPosition(const cChunk & Chunk, const Vector3i Position, const BLOCKTYPE BlockType, const Vector3i QueryPosition, const BLOCKTYPE QueryBlockType, const bool IsLinked) + PowerLevel GetPowerDeliveredToPosition(const cChunk & Chunk, const Vector3i Position, const BLOCKTYPE BlockType, const Vector3i QueryPosition, const BLOCKTYPE QueryBlockType, const bool IsLinked) { INVOKE_FOR_HANDLERS(GetPowerDeliveredToPosition(Chunk, Position, BlockType, QueryPosition, QueryBlockType, IsLinked)); @@ -99,28 +99,16 @@ namespace RedstoneHandler return 0; } - - - - - void Update(cChunk & Chunk, cChunk & CurrentlyTicking, const Vector3i Position, const BLOCKTYPE BlockType, const NIBBLETYPE Meta, const PoweringData PoweringData) + void Update(cChunk & Chunk, cChunk & CurrentlyTicking, const Vector3i Position, const BLOCKTYPE BlockType, const NIBBLETYPE Meta, const PowerLevel PowerLevel) { - INVOKE_FOR_HANDLERS(Update(Chunk, CurrentlyTicking, Position, BlockType, Meta, PoweringData)); + INVOKE_FOR_HANDLERS(Update(Chunk, CurrentlyTicking, Position, BlockType, Meta, PowerLevel)); } - - - - void ForValidSourcePositions(const cChunk & Chunk, const Vector3i Position, const BLOCKTYPE BlockType, const NIBBLETYPE Meta, ForEachSourceCallback & Callback) { INVOKE_FOR_HANDLERS(ForValidSourcePositions(Chunk, Position, BlockType, Meta, Callback)); } - - - - void SetWireState(const cChunk & Chunk, const Vector3i Position) { RedstoneWireHandler::SetWireState(Chunk, Position); -- cgit v1.2.3