1
0

Remove the redstone solid block handler

- Remove cSolidBlockHandler
* Functionality now integrated into simulator dispatcher
* Fix door double open/close issues, arisen due to the top/bottom halves getting different power
+ Small migration to block states for redstone wire
This commit is contained in:
Tiger Wang
2020-08-08 18:22:16 +01:00
parent 2f79ab2e26
commit 40eba5244d
35 changed files with 745 additions and 582 deletions

View File

@@ -0,0 +1,32 @@
#pragma once
#include "ForEachSourceCallback.h"
#include "RedstoneSimulatorChunkData.h"
class ForEachSourceCallback
{
public:
ForEachSourceCallback(const cChunk & Chunk, Vector3i Position, BLOCKTYPE CurrentBlock);
/** Returns whether a potential source position should be treated as linked. */
bool ShouldQueryLinkedPosition(Vector3i Location, BLOCKTYPE Block);
/** Callback invoked for each potential source position of the redstone component. */
void operator()(Vector3i Location);
/** Asks a redstone component at the source position how much power it will deliver to the querying position. */
static PoweringData QueryPower(const cChunk & Chunk, Vector3i SourcePosition, BLOCKTYPE SourceBlock, Vector3i QueryPosition, BLOCKTYPE QueryBlock, bool IsLinked);
/** Asks redstone handlers adjacent to a solid block how much power they will deliver to the querying position, via the solid block. */
static PoweringData QueryLinkedPower(const cChunk & Chunk, Vector3i QueryPosition, BLOCKTYPE QueryBlock, Vector3i SolidBlockPosition);
PoweringData Power;
private:
const cChunk & m_Chunk;
const Vector3i m_Position;
const BLOCKTYPE m_CurrentBlock;
};