From b628cfb7348d02737e3045944ac6e1f311797961 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 26 Nov 2013 21:54:07 +0000 Subject: [PATCH] Fixed repeaters not powering from wire This should also fix comparators (in the future). This also updates XML comments so that they are compatible with Doxygen. --- source/Simulator/RedstoneSimulator.h | 50 +++++++++++++--------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/source/Simulator/RedstoneSimulator.h b/source/Simulator/RedstoneSimulator.h index 25959ac0b..d3002394a 100644 --- a/source/Simulator/RedstoneSimulator.h +++ b/source/Simulator/RedstoneSimulator.h @@ -63,61 +63,61 @@ private: // In addition to being non-performant, it would stop the player from actually breaking said device /* ====== SOURCES ====== */ - ///Handles the redstone torch + /// Handles the redstone torch void HandleRedstoneTorch(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_MyState); - ///Handles the redstone block + /// Handles the redstone block void HandleRedstoneBlock(int a_BlockX, int a_BlockY, int a_BlockZ); - ///Handles levers + /// Handles levers void HandleRedstoneLever(int a_BlockX, int a_BlockY, int a_BlockZ); - ///Handles buttons + /// Handles buttons void HandleRedstoneButton(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType); /* ==================== */ /* ====== CARRIERS ====== */ - ///Handles redstone wire + /// Handles redstone wire void HandleRedstoneWire(int a_BlockX, int a_BlockY, int a_BlockZ); - ///Handles repeaters + /// Handles repeaters void HandleRedstoneRepeater(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_MyState); /* ====================== */ /* ====== DEVICES ====== */ - ///Handles pistons + /// Handles pistons void HandlePiston(int a_BlockX, int a_BlockY, int a_BlockZ); - ///Handles dispensers and droppers + /// Handles dispensers and droppers void HandleDropSpenser(int a_BlockX, int a_BlockY, int a_BlockZ); - ///Handles TNT (exploding) + /// Handles TNT (exploding) void HandleTNT(int a_BlockX, int a_BlockY, int a_BlockZ); - ///Handles redstone lamps + /// Handles redstone lamps void HandleRedstoneLamp(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_MyState); - ///Handles doords + /// Handles doords void HandleDoor(int a_BlockX, int a_BlockY, int a_BlockZ); - ///Handles activator, detector, and powered rails + /// Handles activator, detector, and powered rails void HandleRail(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_MyType); /* ===================== */ /* ====== Helper functions ====== */ - ///Marks a block as powered + /// Marks a block as powered void SetBlockPowered(int a_BlockX, int a_BlockY, int a_BlockZ, int a_SourceX, int a_SourceY, int a_SourceZ, BLOCKTYPE a_SourceBlock); - ///Marks a block as being powered through another block + /// Marks a block as being powered through another block void SetBlockLinkedPowered(int a_BlockX, int a_BlockY, int a_BlockZ, int a_MiddleX, int a_MiddleY, int a_MiddleZ, int a_SourceX, int a_SourceY, int a_SourceZ, BLOCKTYPE a_SourceBlock, BLOCKTYPE a_MiddeBlock); - ///Marks the second block in a direction as linked powered + /// Marks the second block in a direction as linked powered void SetDirectionLinkedPowered(int a_BlockX, int a_BlockY, int a_BlockZ, char a_Direction, BLOCKTYPE a_SourceBlock); - ///Marks all blocks immediately surrounding a coordinate as powered + /// Marks all blocks immediately surrounding a coordinate as powered void SetAllDirsAsPowered(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_SourceBlock); - ///Returns if a coordinate is powered or linked powered + /// Returns if a coordinate is powered or linked powered bool AreCoordsPowered(int a_BlockX, int a_BlockY, int a_BlockZ); - ///Returns if a repeater is powered + /// Returns if a repeater is powered bool IsRepeaterPowered(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_Meta); - ///Returns if lever metadata marks it as emitting power + /// Returns if lever metadata marks it as emitting power bool IsLeverOn(NIBBLETYPE a_BlockMeta); - ///Returns if button metadata marks it as emitting power + /// Returns if button metadata marks it as emitting power bool IsButtonOn(NIBBLETYPE a_BlockMeta); /* ============================== */ /* ====== Misc Functions ====== */ - ///Returns if a block is viable to be the MiddleBlock of a SetLinkedPowered operation + /// Returns if a block is viable to be the MiddleBlock of a SetLinkedPowered operation inline static bool IsViableMiddleBlock(BLOCKTYPE Block) { if (!g_BlockIsSolid[Block]) { return false; } @@ -137,7 +137,7 @@ private: } } - ///Returns if a block is a mechanism (something that accepts power and does something) + /// Returns if a block is a mechanism (something that accepts power and does something) inline static bool IsMechanism(BLOCKTYPE Block) { switch (Block) @@ -166,7 +166,7 @@ private: } } - ///Returns if a block has the potential to output power + /// Returns if a block has the potential to output power inline static bool IsPotentialSource(BLOCKTYPE Block) { switch (Block) @@ -178,10 +178,8 @@ private: case E_BLOCK_REDSTONE_TORCH_ON: case E_BLOCK_LEVER: case E_BLOCK_REDSTONE_REPEATER_ON: - case E_BLOCK_REDSTONE_REPEATER_OFF: case E_BLOCK_BLOCK_OF_REDSTONE: case E_BLOCK_ACTIVE_COMPARATOR: - case E_BLOCK_INACTIVE_COMPARATOR: { return true; } @@ -189,7 +187,7 @@ private: } } - ///Returns if a block is any sort of redstone device + /// Returns if a block is any sort of redstone device inline static bool IsRedstone(BLOCKTYPE Block) { switch (Block)