summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/SmallGateHandler.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/SmallGateHandler.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/SmallGateHandler.h')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/SmallGateHandler.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/SmallGateHandler.h b/src/Simulator/IncrementalRedstoneSimulator/SmallGateHandler.h
index 1844f417d..6c201f354 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/SmallGateHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/SmallGateHandler.h
@@ -12,13 +12,9 @@ class cSmallGateHandler : public cRedstoneHandler
typedef cRedstoneHandler super;
public:
- cSmallGateHandler(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);
@@ -27,28 +23,30 @@ 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 gateydory the fence gate/trapdoor (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
-
- if (a_PoweringData != static_cast<cIncrementalRedstoneSimulator *>(m_World.GetRedstoneSimulator())->GetChunkData()->ExchangeUpdateOncePowerData(a_Position, a_PoweringData))
+ auto Data = static_cast<cIncrementalRedstoneSimulator *>(a_World.GetRedstoneSimulator())->GetChunkData();
+ if (a_PoweringData != Data->ExchangeUpdateOncePowerData(a_Position, a_PoweringData))
{
- m_World.SetBlockMeta(a_Position, (a_PoweringData.PowerLevel > 0) ? (a_Meta | 0x4) : (a_Meta & ~0x04));
+ a_World.SetBlockMeta(a_Position, (a_PoweringData.PowerLevel > 0) ? (a_Meta | 0x4) : (a_Meta & ~0x04));
}
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);
UNUSED(a_Meta);
return GetAdjustedRelatives(a_Position, GetRelativeAdjacents());;