26 ASSERT(!
"Unhandled torch metadata");
34 const auto QueryOffset = a_QueryPosition - a_Position;
39 (IsLinked && (QueryOffset !=
OffsetYP))
53 auto DelayInfo = Data.GetMechanismDelayInfo(a_Position);
55 if (DelayInfo ==
nullptr)
57 const bool ShouldBeOn = (
Power == 0);
58 if (ShouldBeOn !=
IsOn(a_BlockType))
60 Data.m_MechanismDelays[a_Position] = std::make_pair(1, ShouldBeOn);
76 Data.m_MechanismDelays.erase(a_Position);
@ E_BLOCK_REDSTONE_TORCH_ON
@ E_BLOCK_REDSTONE_TORCH_OFF
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
constexpr Vector3i OffsetYP
auto & DataForChunk(const cChunk &a_Chunk)
constexpr std::array< Vector3i, 6 > RelativeAdjacents
void UpdateAdjustedRelative(const cChunk &a_Chunk, const cChunk &a_TickingChunk, const Vector3i a_Position, const Vector3i a_Offset)
unsigned char Power(const BlockState Block)
static bool ShouldPowerOn(cChunk &Chunk, const Vector3i a_Position, NIBBLETYPE a_Meta, cIncrementalRedstoneSimulatorChunkData &a_Data)
static void Update(cChunk &a_Chunk, cChunk &CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
static bool IsOn(BLOCKTYPE a_Block)
static void ForValidSourcePositions(const cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback &Callback)
static Vector3i GetOffsetAttachedTo(const NIBBLETYPE a_Meta)
static PowerLevel GetPowerDeliveredToPosition(const cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta)