summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-01-21 23:51:55 +0100
committerTiger Wang <ziwei.tiger@outlook.com>2021-01-22 23:04:47 +0100
commit19302eeb87e6b915786ea7fa156ac3bc2ce451b4 (patch)
treecf9bd3dbf2fe5617c315a20c453b58655c664f89 /src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h
parentEnd crystal placement (#5112) (diff)
downloadcuberite-19302eeb87e6b915786ea7fa156ac3bc2ce451b4.tar
cuberite-19302eeb87e6b915786ea7fa156ac3bc2ce451b4.tar.gz
cuberite-19302eeb87e6b915786ea7fa156ac3bc2ce451b4.tar.bz2
cuberite-19302eeb87e6b915786ea7fa156ac3bc2ce451b4.tar.lz
cuberite-19302eeb87e6b915786ea7fa156ac3bc2ce451b4.tar.xz
cuberite-19302eeb87e6b915786ea7fa156ac3bc2ce451b4.tar.zst
cuberite-19302eeb87e6b915786ea7fa156ac3bc2ce451b4.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h b/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h
index 66709293a..db622520a 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h
@@ -20,7 +20,7 @@ namespace RedstoneWireHandler
/** Invokes Callback with the wire's left, front, and right direction state corresponding to Offset.
Returns a new block constructed from the directions that the callback may have modified. */
template <class OffsetCallback>
- inline BlockState DoWithDirectionState(const Vector3i Offset, BlockState Block, OffsetCallback Callback)
+ static BlockState DoWithDirectionState(const Vector3i Offset, BlockState Block, OffsetCallback Callback)
{
auto North = Block::RedstoneWire::North(Block);
auto South = Block::RedstoneWire::South(Block);
@@ -49,7 +49,7 @@ namespace RedstoneWireHandler
}
/** Adjusts a given wire block so that the direction represented by Offset has state Direction. */
- inline void SetDirectionState(const Vector3i Offset, BlockState & Block, TemporaryDirection Direction)
+ static void SetDirectionState(const Vector3i Offset, BlockState & Block, TemporaryDirection Direction)
{
Block = DoWithDirectionState(Offset, Block, [Direction](auto, auto & Front, auto)
{
@@ -70,7 +70,7 @@ namespace RedstoneWireHandler
});
}
- inline bool IsDirectlyConnectingMechanism(BLOCKTYPE a_Block, NIBBLETYPE a_BlockMeta, const Vector3i a_Offset)
+ static bool IsDirectlyConnectingMechanism(BLOCKTYPE a_Block, NIBBLETYPE a_BlockMeta, const Vector3i a_Offset)
{
switch (a_Block)
{
@@ -102,7 +102,7 @@ namespace RedstoneWireHandler
/** Temporary. Discovers a wire's connection state, including terracing, storing the block inside redstone chunk data.
TODO: once the server supports block states this should go in the block handler, with data saved in the world. */
- inline void SetWireState(const cChunk & Chunk, const Vector3i Position)
+ static void SetWireState(const cChunk & Chunk, const Vector3i Position)
{
auto Block = Block::RedstoneWire::RedstoneWire();
const auto YPTerraceBlock = Chunk.GetBlock(Position + OffsetYP);
@@ -192,7 +192,7 @@ namespace RedstoneWireHandler
DataForChunk(Chunk).WireStates.emplace(Position, Block);
}
- inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
+ static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{
// Starts off as the wire's meta value, modified appropriately and returned
auto Power = a_Chunk.GetMeta(a_Position);
@@ -256,7 +256,7 @@ namespace RedstoneWireHandler
return Power;
}
- inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
+ static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{
// LOGD("Evaluating dusty the wire (%d %d %d) %i", a_Position.x, a_Position.y, a_Position.z, Power);
@@ -279,7 +279,7 @@ namespace RedstoneWireHandler
}
}
- inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
+ static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{
UNUSED(a_BlockType);
UNUSED(a_Meta);