Refactored code to use vectors in the cPistonHandler class

This commit is contained in:
bibo38
2015-11-07 17:34:54 +01:00
parent 429f615390
commit ea55e75672
3 changed files with 42 additions and 52 deletions
+3 -3
View File
@@ -84,8 +84,8 @@ public:
/** Converts piston block's metadata into a unit vector representing the direction in which the piston will extend. */
static Vector3i MetadataToOffset(NIBBLETYPE a_PistonMeta);
static void ExtendPiston(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World);
static void RetractPiston(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World);
static void ExtendPiston(Vector3i a_BlockPos, cWorld * a_World);
static void RetractPiston(Vector3i a_BlockPos, cWorld * a_World);
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{
@@ -150,7 +150,7 @@ private:
/** Tries to push a block and increases the pushed blocks variable. Returns true if the block is pushable */
static bool CanPushBlock(
int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World, bool a_RequirePushable,
const Vector3i & a_BlockPos, cWorld * a_World, bool a_RequirePushable,
Vector3iSet & a_BlocksPushed, const Vector3i & a_PushDir
);