summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-08-20 21:04:28 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-21 01:50:09 +0200
commitd8c8d0124da12587bbaf52992f7a8d2e0b010544 (patch)
tree305983c82fdb55ec7f9bc37cda1b54304f4a0ecf /src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.h
parentcChunk's deleted copy constructor needs const (diff)
downloadcuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar.gz
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar.bz2
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar.lz
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar.xz
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar.zst
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.h')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.h b/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.h
index 5b3dcdeac..25c646df3 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.h
@@ -8,11 +8,19 @@ class ForEachSourceCallback;
namespace RedstoneHandler
{
- unsigned char GetPowerDeliveredToPosition(const cChunk & Chunk, Vector3i Position, BLOCKTYPE BlockType, Vector3i QueryPosition, BLOCKTYPE QueryBlockType, bool IsLinked);
+ /** Asks a redstone component at the source position how much power it will deliver to the querying position.
+ If IsLinked is true, QueryPosition should point to the intermediate conduit block.
+ The Position and QueryPosition are both relative to Chunk. */
+ PowerLevel GetPowerDeliveredToPosition(const cChunk & Chunk, Vector3i Position, BLOCKTYPE BlockType, Vector3i QueryPosition, BLOCKTYPE QueryBlockType, bool IsLinked);
- void Update(cChunk & Chunk, cChunk & CurrentlyTicking, Vector3i Position, BLOCKTYPE BlockType, NIBBLETYPE Meta, PoweringData PoweringData);
+ /** Tells a redstone component at this position to update itself.
+ PowerLevel represents the maximum power level all of its source positions gave to it.
+ Position is relative to Chunk, but if the component needs to queue neighbour updates, they are queued to CurrentlyTicking. */
+ void Update(cChunk & Chunk, cChunk & CurrentlyTicking, Vector3i Position, BLOCKTYPE BlockType, NIBBLETYPE Meta, PowerLevel PowerLevel);
+ /** Invokes Callback for each position this component can accept power from. */
void ForValidSourcePositions(const cChunk & Chunk, Vector3i Position, BLOCKTYPE BlockType, NIBBLETYPE Meta, ForEachSourceCallback & Callback);
+ /** Temporary: compute and set the block state of a redstone wire. */
void SetWireState(const cChunk & Chunk, Vector3i Position);
}