diff --git a/Minecraft.World/Facing.cpp b/Minecraft.World/Facing.cpp index 33742e9..b6bb931 100644 --- a/Minecraft.World/Facing.cpp +++ b/Minecraft.World/Facing.cpp @@ -21,4 +21,9 @@ const int Facing::STEP_Z[6] = 0, 0, -1, 1, 0, 0 }; -const wstring Facing::NAMES[] = {L"DOWN", L"UP", L"NORTH", L"SOUTH", L"WEST", L"EAST"}; \ No newline at end of file +const wstring Facing::NAMES[] = {L"DOWN", L"UP", L"NORTH", L"SOUTH", L"WEST", L"EAST"}; + +int Facing::getOpposite(int facing) +{ + return OPPOSITE_FACING[facing]; +} \ No newline at end of file diff --git a/Minecraft.World/Facing.h b/Minecraft.World/Facing.h index b257e4b..922bd9d 100644 --- a/Minecraft.World/Facing.h +++ b/Minecraft.World/Facing.h @@ -16,4 +16,5 @@ public: static const int STEP_Z[6]; static const wstring NAMES[]; + static int getOpposite(int facing); }; \ No newline at end of file