Redstone: inline -> static
This commit is contained in:
parent
4f3b699b27
commit
19302eeb87
@ -9,7 +9,7 @@
|
||||
|
||||
namespace CommandBlockHandler
|
||||
{
|
||||
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)
|
||||
{
|
||||
UNUSED(a_Chunk);
|
||||
UNUSED(a_Position);
|
||||
@ -20,7 +20,7 @@ namespace CommandBlockHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
{
|
||||
// LOGD("Evaluating commander the cmdblck (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -38,7 +38,7 @@ namespace CommandBlockHandler
|
||||
});
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace DaylightSensorHandler
|
||||
{
|
||||
inline PowerLevel GetPowerLevel(const cChunk & a_Chunk, const Vector3i a_Position)
|
||||
static PowerLevel GetPowerLevel(const cChunk & a_Chunk, const Vector3i a_Position)
|
||||
{
|
||||
if (a_Chunk.GetBlock(a_Position) == E_BLOCK_INVERTED_DAYLIGHT_SENSOR)
|
||||
{
|
||||
@ -27,7 +27,7 @@ namespace DaylightSensorHandler
|
||||
return static_cast<PowerLevel>(std::clamp(RawOutput, 0.f, 15.f));
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
UNUSED(a_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
@ -37,7 +37,7 @@ namespace DaylightSensorHandler
|
||||
return IsLinked ? 0 : a_Chunk.GetMeta(a_Position);
|
||||
}
|
||||
|
||||
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 Darryl the daylight sensor (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -52,7 +52,7 @@ namespace DaylightSensorHandler
|
||||
}
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_Position);
|
||||
|
@ -11,7 +11,7 @@ namespace DoorHandler
|
||||
{
|
||||
// "Doormammu, I've come to bargain"
|
||||
|
||||
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)
|
||||
{
|
||||
UNUSED(a_Chunk);
|
||||
UNUSED(a_Position);
|
||||
@ -22,7 +22,7 @@ namespace DoorHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
@ -30,7 +30,7 @@ namespace DoorHandler
|
||||
InvokeForAdjustedRelatives(Callback, a_Position, RelativeAdjacents);
|
||||
}
|
||||
|
||||
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, PowerLevel Power)
|
||||
static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, PowerLevel Power)
|
||||
{
|
||||
// LOGD("Evaluating dori the door (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
|
@ -9,12 +9,12 @@
|
||||
|
||||
namespace DropSpenserHandler
|
||||
{
|
||||
inline bool IsActivated(NIBBLETYPE a_Meta)
|
||||
static bool IsActivated(NIBBLETYPE a_Meta)
|
||||
{
|
||||
return (a_Meta & E_META_DROPSPENSER_ACTIVATED) != 0;
|
||||
}
|
||||
|
||||
inline NIBBLETYPE SetActivationState(NIBBLETYPE a_Meta, bool IsOn)
|
||||
static NIBBLETYPE SetActivationState(NIBBLETYPE a_Meta, bool IsOn)
|
||||
{
|
||||
if (IsOn)
|
||||
{
|
||||
@ -26,7 +26,7 @@ namespace DropSpenserHandler
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
UNUSED(a_Chunk);
|
||||
UNUSED(a_Position);
|
||||
@ -37,7 +37,7 @@ namespace DropSpenserHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
{
|
||||
// LOGD("Evaluating spencer the dropspenser (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -60,7 +60,7 @@ namespace DropSpenserHandler
|
||||
}
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace HopperHandler
|
||||
{
|
||||
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)
|
||||
{
|
||||
UNUSED(a_Chunk);
|
||||
UNUSED(a_Position);
|
||||
@ -20,7 +20,7 @@ namespace HopperHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
{
|
||||
// LOGD("Evaluating holey the hopper (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -37,7 +37,7 @@ namespace HopperHandler
|
||||
});
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace NoteBlockHandler
|
||||
{
|
||||
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)
|
||||
{
|
||||
UNUSED(a_Chunk);
|
||||
UNUSED(a_Position);
|
||||
@ -20,7 +20,7 @@ namespace NoteBlockHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
{
|
||||
// LOGD("Evaluating sparky the magical note block (%d %d %d) %i", a_Position.x, a_Position.y, a_Position.z, Power);
|
||||
|
||||
@ -38,7 +38,7 @@ namespace NoteBlockHandler
|
||||
});
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
|
@ -9,12 +9,12 @@
|
||||
|
||||
namespace ObserverHandler
|
||||
{
|
||||
inline bool IsOn(NIBBLETYPE a_Meta)
|
||||
static bool IsOn(NIBBLETYPE a_Meta)
|
||||
{
|
||||
return (a_Meta & 0x8) == 0x8;
|
||||
}
|
||||
|
||||
inline bool ShouldPowerOn(cChunk & Chunk, const Vector3i a_Position, NIBBLETYPE a_Meta, cIncrementalRedstoneSimulatorChunkData & a_Data)
|
||||
static bool ShouldPowerOn(cChunk & Chunk, const Vector3i a_Position, NIBBLETYPE a_Meta, cIncrementalRedstoneSimulatorChunkData & a_Data)
|
||||
{
|
||||
BLOCKTYPE BlockType;
|
||||
NIBBLETYPE BlockMeta;
|
||||
@ -46,13 +46,13 @@ namespace ObserverHandler
|
||||
return Previous != Observed;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
const auto Meta = a_Chunk.GetMeta(a_Position);
|
||||
return (IsOn(Meta) && (a_QueryPosition == (a_Position + cBlockObserverHandler::GetSignalOutputOffset(Meta)))) ? 15 : 0;
|
||||
}
|
||||
|
||||
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 Lenny the observer (%i %i %i)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -98,7 +98,7 @@ namespace ObserverHandler
|
||||
UpdateAdjustedRelative(a_Chunk, CurrentlyTicking, a_Position, cBlockObserverHandler::GetSignalOutputOffset(a_Meta));
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_Position);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace PistonHandler
|
||||
{
|
||||
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)
|
||||
{
|
||||
UNUSED(a_Chunk);
|
||||
UNUSED(a_Position);
|
||||
@ -20,7 +20,7 @@ namespace PistonHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
{
|
||||
// LOGD("Evaluating pisty the piston (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -45,7 +45,7 @@ namespace PistonHandler
|
||||
// However, this delay is already present: as a side effect of the implementation of piston animation in Blocks\BlockPiston.cpp
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
|
@ -9,7 +9,7 @@ namespace PoweredRailHandler
|
||||
{
|
||||
/** Get the offset along which the rail faces.
|
||||
Not in cBlockRailHandler since specific to powered rails. */
|
||||
inline Vector3i GetPoweredRailAdjacentXZCoordinateOffset(NIBBLETYPE a_Meta)
|
||||
static Vector3i GetPoweredRailAdjacentXZCoordinateOffset(NIBBLETYPE a_Meta)
|
||||
{
|
||||
switch (a_Meta & 0x7)
|
||||
{
|
||||
@ -27,7 +27,7 @@ namespace PoweredRailHandler
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
UNUSED(a_QueryBlockType);
|
||||
|
||||
@ -41,7 +41,7 @@ namespace PoweredRailHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTickingChunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
static void Update(cChunk & a_Chunk, cChunk & CurrentlyTickingChunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
{
|
||||
// LOGD("Evaluating tracky the rail (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -78,7 +78,7 @@ namespace PoweredRailHandler
|
||||
}
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_Meta);
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace PressurePlateHandler
|
||||
{
|
||||
inline unsigned char GetPowerLevel(const cChunk & Chunk, const Vector3i Position, const BLOCKTYPE BlockType)
|
||||
static unsigned char GetPowerLevel(const cChunk & Chunk, const Vector3i Position, const BLOCKTYPE BlockType)
|
||||
{
|
||||
size_t NumberOfEntities = 0;
|
||||
bool FoundPlayer = false;
|
||||
@ -58,7 +58,7 @@ namespace PressurePlateHandler
|
||||
}
|
||||
}
|
||||
|
||||
inline const char * GetClickOnSound(BLOCKTYPE a_BlockType)
|
||||
static const char * GetClickOnSound(BLOCKTYPE a_BlockType)
|
||||
{
|
||||
// manage on-sound
|
||||
switch (a_BlockType)
|
||||
@ -75,7 +75,7 @@ namespace PressurePlateHandler
|
||||
}
|
||||
}
|
||||
|
||||
inline const char * GetClickOffSound(BLOCKTYPE a_BlockType)
|
||||
static const char * GetClickOffSound(BLOCKTYPE a_BlockType)
|
||||
{
|
||||
// manage off-sound
|
||||
switch (a_BlockType)
|
||||
@ -92,7 +92,7 @@ namespace PressurePlateHandler
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
UNUSED(a_BlockType);
|
||||
UNUSED(a_QueryPosition);
|
||||
@ -103,7 +103,7 @@ namespace PressurePlateHandler
|
||||
return (IsLinked && (a_QueryPosition != (a_Position + OffsetYM))) ? 0 : DataForChunk(a_Chunk).GetCachedPowerData(a_Position);
|
||||
}
|
||||
|
||||
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 clicky the pressure plate (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -205,7 +205,7 @@ namespace PressurePlateHandler
|
||||
UpdateAdjustedRelatives(a_Chunk, CurrentlyTicking, a_Position, RelativeAdjacents);
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_Position);
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace RedstoneBlockHandler
|
||||
{
|
||||
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)
|
||||
{
|
||||
UNUSED(a_Chunk);
|
||||
UNUSED(a_Position);
|
||||
@ -17,12 +17,12 @@ namespace RedstoneBlockHandler
|
||||
return IsLinked ? 0 : 15;
|
||||
}
|
||||
|
||||
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 crimson the redstone block (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_Position);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace RedstoneComparatorHandler
|
||||
{
|
||||
inline unsigned char GetFrontPowerLevel(NIBBLETYPE a_Meta, unsigned char a_HighestSidePowerLevel, unsigned char a_HighestRearPowerLevel)
|
||||
static unsigned char GetFrontPowerLevel(NIBBLETYPE a_Meta, unsigned char a_HighestSidePowerLevel, unsigned char a_HighestRearPowerLevel)
|
||||
{
|
||||
if (cBlockComparatorHandler::IsInSubtractionMode(a_Meta))
|
||||
{
|
||||
@ -23,7 +23,7 @@ namespace RedstoneComparatorHandler
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
UNUSED(a_QueryPosition);
|
||||
UNUSED(a_QueryBlockType);
|
||||
@ -35,7 +35,7 @@ namespace RedstoneComparatorHandler
|
||||
);
|
||||
}
|
||||
|
||||
inline unsigned char GetPowerLevel(cChunk & a_Chunk, Vector3i Position, BLOCKTYPE BlockType, NIBBLETYPE Meta)
|
||||
static unsigned char GetPowerLevel(cChunk & a_Chunk, Vector3i Position, BLOCKTYPE BlockType, NIBBLETYPE Meta)
|
||||
{
|
||||
UInt8 SignalStrength = 0;
|
||||
auto RearCoordinate = cBlockComparatorHandler::GetRearCoordinate(Position, Meta & 0x3);
|
||||
@ -79,7 +79,7 @@ namespace RedstoneComparatorHandler
|
||||
);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
// Note that Power here contains the maximum * side * power level, as specified by GetValidSourcePositions
|
||||
// LOGD("Evaluating ALU the comparator (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
@ -125,7 +125,7 @@ namespace RedstoneComparatorHandler
|
||||
UpdateAdjustedRelative(a_Chunk, CurrentlyTicking, a_Position, cBlockComparatorHandler::GetFrontCoordinate(a_Position, a_Meta & 0x3) - a_Position);
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
|
@ -7,17 +7,17 @@
|
||||
|
||||
namespace RedstoneLampHandler
|
||||
{
|
||||
inline bool IsOn(BLOCKTYPE a_BlockType)
|
||||
static bool IsOn(BLOCKTYPE a_BlockType)
|
||||
{
|
||||
return (a_BlockType == E_BLOCK_REDSTONE_LAMP_ON);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
{
|
||||
// LOGD("Evaluating lamp (%i %i %i)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -37,7 +37,7 @@ namespace RedstoneLampHandler
|
||||
}
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_Meta);
|
||||
|
@ -9,14 +9,14 @@
|
||||
|
||||
namespace RedstoneRepeaterHandler
|
||||
{
|
||||
inline bool IsOn(BLOCKTYPE a_Block)
|
||||
static bool IsOn(BLOCKTYPE a_Block)
|
||||
{
|
||||
return (a_Block == E_BLOCK_REDSTONE_REPEATER_ON);
|
||||
}
|
||||
|
||||
/** Returns a pair with first element indicating if the block at the given position is an activated repeater.
|
||||
If it is activated, the second element is the repeater metadata. */
|
||||
inline std::pair<bool, NIBBLETYPE> IsOnRepeater(cChunk & Chunk, const Vector3i a_Position)
|
||||
static std::pair<bool, NIBBLETYPE> IsOnRepeater(cChunk & Chunk, const Vector3i a_Position)
|
||||
{
|
||||
BLOCKTYPE Type;
|
||||
NIBBLETYPE Meta;
|
||||
@ -32,7 +32,7 @@ namespace RedstoneRepeaterHandler
|
||||
/** Determine, from the metadata of a repeater on our left side, if they lock us.
|
||||
To test a repeater on our right, simply invert the order of arguments provided.
|
||||
"Left" is relative to the direction the repeater output faces, naturally. */
|
||||
inline bool DoesLhsLockMe(NIBBLETYPE a_MetaLhs, NIBBLETYPE a_MyMeta)
|
||||
static bool DoesLhsLockMe(NIBBLETYPE a_MetaLhs, NIBBLETYPE a_MyMeta)
|
||||
{
|
||||
// Get the direction bits
|
||||
a_MetaLhs &= E_META_REDSTONE_REPEATER_FACING_MASK;
|
||||
@ -64,7 +64,7 @@ namespace RedstoneRepeaterHandler
|
||||
/** Determine if a repeater is locked.
|
||||
A locked repeater is one with another powered repeater facing them, to their immediate left or right sides.
|
||||
"Left" is relative to the direction the repeater output faces, naturally. */
|
||||
inline bool IsLocked(cChunk & Chunk, const Vector3i a_Position, const NIBBLETYPE a_Meta)
|
||||
static bool IsLocked(cChunk & Chunk, const Vector3i a_Position, const NIBBLETYPE a_Meta)
|
||||
{
|
||||
// The left hand side offset. Will be negated to get the rhs offset
|
||||
const auto LhsOffset = cBlockRedstoneRepeaterHandler::GetLeftCoordinateOffset(a_Meta);
|
||||
@ -81,7 +81,7 @@ namespace RedstoneRepeaterHandler
|
||||
return Rhs.first && DoesLhsLockMe(a_Meta, Rhs.second);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (!IsOn(a_BlockType))
|
||||
{
|
||||
@ -98,7 +98,7 @@ namespace RedstoneRepeaterHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
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 loopy the repeater (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -148,7 +148,7 @@ namespace RedstoneRepeaterHandler
|
||||
UpdateAdjustedRelative(a_Chunk, CurrentlyTicking, a_Position, cBlockRedstoneRepeaterHandler::GetFrontCoordinateOffset(a_Meta));
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
Callback(cBlockRedstoneRepeaterHandler::GetRearCoordinateOffset(a_Meta) + a_Position);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace RedstoneToggleHandler
|
||||
{
|
||||
inline Vector3i GetOffsetAttachedTo(Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta)
|
||||
static Vector3i GetOffsetAttachedTo(Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta)
|
||||
{
|
||||
switch (a_BlockType)
|
||||
{
|
||||
@ -59,7 +59,7 @@ namespace RedstoneToggleHandler
|
||||
}
|
||||
}
|
||||
|
||||
inline unsigned char GetPowerLevel(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta)
|
||||
static unsigned char GetPowerLevel(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta)
|
||||
{
|
||||
switch (a_BlockType)
|
||||
{
|
||||
@ -74,7 +74,7 @@ namespace RedstoneToggleHandler
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
UNUSED(a_QueryBlockType);
|
||||
|
||||
@ -89,12 +89,12 @@ namespace RedstoneToggleHandler
|
||||
return GetPowerLevel(a_BlockType, Meta);
|
||||
}
|
||||
|
||||
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 templatio<> the lever/button (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_Position);
|
||||
|
@ -7,12 +7,12 @@
|
||||
|
||||
namespace RedstoneTorchHandler
|
||||
{
|
||||
inline bool IsOn(BLOCKTYPE a_Block)
|
||||
static bool IsOn(BLOCKTYPE a_Block)
|
||||
{
|
||||
return (a_Block == E_BLOCK_REDSTONE_TORCH_ON);
|
||||
}
|
||||
|
||||
inline Vector3i GetOffsetAttachedTo(const NIBBLETYPE a_Meta)
|
||||
static Vector3i GetOffsetAttachedTo(const NIBBLETYPE a_Meta)
|
||||
{
|
||||
switch (a_Meta)
|
||||
{
|
||||
@ -29,7 +29,7 @@ namespace RedstoneTorchHandler
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
const auto QueryOffset = a_QueryPosition - a_Position;
|
||||
|
||||
@ -45,7 +45,7 @@ namespace RedstoneTorchHandler
|
||||
return 15;
|
||||
}
|
||||
|
||||
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 torchy the redstone torch (%i %i %i)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -86,7 +86,7 @@ namespace RedstoneTorchHandler
|
||||
}
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
|
@ -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);
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace SmallGateHandler
|
||||
{
|
||||
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)
|
||||
{
|
||||
UNUSED(a_Chunk);
|
||||
UNUSED(a_Position);
|
||||
@ -18,7 +18,7 @@ namespace SmallGateHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
{
|
||||
// LOGD("Evaluating gateydory the fence gate/trapdoor (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -33,7 +33,7 @@ namespace SmallGateHandler
|
||||
}
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace TNTHandler
|
||||
{
|
||||
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)
|
||||
{
|
||||
UNUSED(a_Chunk);
|
||||
UNUSED(a_Position);
|
||||
@ -18,7 +18,7 @@ namespace TNTHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
|
||||
{
|
||||
// LOGD("Evaluating explodinator the trinitrotoluene (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
if (Power != 0)
|
||||
@ -28,7 +28,7 @@ namespace TNTHandler
|
||||
}
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace TrappedChestHandler
|
||||
{
|
||||
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)
|
||||
{
|
||||
UNUSED(a_BlockType);
|
||||
UNUSED(a_QueryPosition);
|
||||
@ -19,7 +19,7 @@ namespace TrappedChestHandler
|
||||
return DataForChunk(a_Chunk).GetCachedPowerData(a_Position);
|
||||
}
|
||||
|
||||
inline unsigned char GetPowerLevel(cChunk & a_Chunk, Vector3i a_Position)
|
||||
static unsigned char GetPowerLevel(cChunk & a_Chunk, Vector3i a_Position)
|
||||
{
|
||||
int NumberOfPlayers = 0;
|
||||
VERIFY(
|
||||
@ -34,7 +34,7 @@ namespace TrappedChestHandler
|
||||
return static_cast<unsigned char>(std::min(NumberOfPlayers, 15));
|
||||
}
|
||||
|
||||
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 tricky the trapped chest (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -47,7 +47,7 @@ namespace TrappedChestHandler
|
||||
}
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_Position);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace TripwireHookHandler
|
||||
{
|
||||
inline unsigned char GetPowerLevel(const cChunk & a_Chunk, Vector3i a_Position, NIBBLETYPE a_Meta)
|
||||
static unsigned char GetPowerLevel(const cChunk & a_Chunk, Vector3i a_Position, NIBBLETYPE a_Meta)
|
||||
{
|
||||
bool FoundActivated = false;
|
||||
const auto FaceToGoTowards = cBlockTripwireHookHandler::MetadataToDirection(a_Meta);
|
||||
@ -60,7 +60,7 @@ namespace TripwireHookHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
UNUSED(a_BlockType);
|
||||
UNUSED(a_QueryBlockType);
|
||||
@ -69,7 +69,7 @@ namespace TripwireHookHandler
|
||||
return (GetPowerLevel(a_Chunk, a_Position, a_Chunk.GetMeta(a_Position)) == 15) ? 15 : 0;
|
||||
}
|
||||
|
||||
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 hooky the tripwire hook (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
|
||||
|
||||
@ -101,7 +101,7 @@ namespace TripwireHookHandler
|
||||
}
|
||||
}
|
||||
|
||||
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_Chunk);
|
||||
UNUSED(a_BlockType);
|
||||
|
Loading…
Reference in New Issue
Block a user