summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/PistonHandler.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-07-15 04:09:55 +0200
committerLukas Pioch <lukas@zgow.de>2017-07-17 21:40:43 +0200
commit60dfaa09679219868e58a44d6d86f5d8d524ce24 (patch)
tree66bbbc719322c331b68ab9f49b7a07ef7a870c1f /src/Simulator/IncrementalRedstoneSimulator/PistonHandler.h
parentSimulators: Added area-based wakeup. (diff)
downloadcuberite-60dfaa09679219868e58a44d6d86f5d8d524ce24.tar
cuberite-60dfaa09679219868e58a44d6d86f5d8d524ce24.tar.gz
cuberite-60dfaa09679219868e58a44d6d86f5d8d524ce24.tar.bz2
cuberite-60dfaa09679219868e58a44d6d86f5d8d524ce24.tar.lz
cuberite-60dfaa09679219868e58a44d6d86f5d8d524ce24.tar.xz
cuberite-60dfaa09679219868e58a44d6d86f5d8d524ce24.tar.zst
cuberite-60dfaa09679219868e58a44d6d86f5d8d524ce24.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/PistonHandler.h')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/PistonHandler.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/PistonHandler.h b/src/Simulator/IncrementalRedstoneSimulator/PistonHandler.h
index f82ebdf94..f41fad89d 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/PistonHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/PistonHandler.h
@@ -13,13 +13,9 @@ class cPistonHandler : public cRedstoneHandler
typedef cRedstoneHandler super;
public:
- cPistonHandler(cWorld & a_World) :
- super(a_World)
- {
- }
-
- virtual unsigned char GetPowerDeliveredToPosition(const Vector3i & a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const Vector3i & a_QueryPosition, BLOCKTYPE a_QueryBlockType) override
+ virtual unsigned char GetPowerDeliveredToPosition(cWorld & a_World, const Vector3i & a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const Vector3i & a_QueryPosition, BLOCKTYPE a_QueryBlockType) const override
{
+ UNUSED(a_World);
UNUSED(a_Position);
UNUSED(a_BlockType);
UNUSED(a_Meta);
@@ -28,18 +24,19 @@ public:
return 0;
}
- virtual unsigned char GetPowerLevel(const Vector3i & a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) override
+ virtual unsigned char GetPowerLevel(cWorld & a_World, const Vector3i & a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) const override
{
+ UNUSED(a_World);
UNUSED(a_Position);
UNUSED(a_BlockType);
UNUSED(a_Meta);
return 0;
}
- virtual cVector3iArray Update(const Vector3i & a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, PoweringData a_PoweringData) override
+ virtual cVector3iArray Update(cWorld & a_World, const Vector3i & a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, PoweringData a_PoweringData) const override
{
// LOGD("Evaluating pisty the piston (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
- auto Data = static_cast<cIncrementalRedstoneSimulator *>(m_World.GetRedstoneSimulator())->GetChunkData();
+ auto Data = static_cast<cIncrementalRedstoneSimulator *>(a_World.GetRedstoneSimulator())->GetChunkData();
auto DelayInfo = Data->GetMechanismDelayInfo(a_Position);
// Delay is used here to prevent an infinite loop (#3168)
@@ -61,11 +58,11 @@ public:
{
if (ShouldBeExtended)
{
- cBlockPistonHandler::ExtendPiston(a_Position, &m_World);
+ cBlockPistonHandler::ExtendPiston(a_Position, a_World);
}
else
{
- cBlockPistonHandler::RetractPiston(a_Position, &m_World);
+ cBlockPistonHandler::RetractPiston(a_Position, a_World);
}
Data->m_MechanismDelays.erase(a_Position);
@@ -75,8 +72,9 @@ public:
return {};
}
- virtual cVector3iArray GetValidSourcePositions(const Vector3i & a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) override
+ virtual cVector3iArray GetValidSourcePositions(cWorld & a_World, const Vector3i & a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) const override
{
+ UNUSED(a_World);
UNUSED(a_BlockType);
auto PositionsOffset = GetRelativeAdjacents();