summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/RedstoneLampHandler.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/RedstoneLampHandler.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/RedstoneLampHandler.h')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/RedstoneLampHandler.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneLampHandler.h b/src/Simulator/IncrementalRedstoneSimulator/RedstoneLampHandler.h
index 4d6902feb..5d9cd241b 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneLampHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneLampHandler.h
@@ -11,27 +11,22 @@ class cRedstoneLampHandler : public cRedstoneHandler
{
public:
- cRedstoneLampHandler(cWorld & a_World) :
- cRedstoneHandler(a_World)
- {
- }
-
inline static bool IsOn(BLOCKTYPE a_BlockType)
{
return (a_BlockType == E_BLOCK_REDSTONE_LAMP_ON);
}
- 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
{
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
{
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 lamp (%i %i %i)", a_Position.x, a_Position.y, a_Position.z);
@@ -39,22 +34,23 @@ public:
{
if (!IsOn(a_BlockType))
{
- m_World.SetBlock(a_Position.x, a_Position.y, a_Position.z, E_BLOCK_REDSTONE_LAMP_ON, 0);
+ a_World.SetBlock(a_Position.x, a_Position.y, a_Position.z, E_BLOCK_REDSTONE_LAMP_ON, 0);
}
}
else
{
if (IsOn(a_BlockType))
{
- m_World.SetBlock(a_Position.x, a_Position.y, a_Position.z, E_BLOCK_REDSTONE_LAMP_OFF, 0);
+ a_World.SetBlock(a_Position.x, a_Position.y, a_Position.z, E_BLOCK_REDSTONE_LAMP_OFF, 0);
}
}
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_Meta);
UNUSED(a_BlockType);
return GetAdjustedRelatives(a_Position, GetRelativeAdjacents());