mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Auxiliary class for Direction, preparation for autodetection of the broken side of the block
This commit is contained in:
parent
fde50c1728
commit
91ef890bb6
4 changed files with 43 additions and 3 deletions
39
MinecraftClient/Mapping/DirectionExtensions.cs
Normal file
39
MinecraftClient/Mapping/DirectionExtensions.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
namespace MinecraftClient.Mapping
|
||||
{
|
||||
public static class DirectionExtensions
|
||||
{
|
||||
public static Direction GetOpposite(this Direction direction)
|
||||
{
|
||||
switch (direction)
|
||||
{
|
||||
case Direction.SouthEast:
|
||||
return Direction.NorthEast;
|
||||
case Direction.SouthWest:
|
||||
return Direction.NorthWest;
|
||||
|
||||
case Direction.NorthEast:
|
||||
return Direction.SouthEast;
|
||||
case Direction.NorthWest:
|
||||
return Direction.SouthWest;
|
||||
|
||||
case Direction.West:
|
||||
return Direction.East;
|
||||
case Direction.East:
|
||||
return Direction.West;
|
||||
|
||||
case Direction.North:
|
||||
return Direction.South;
|
||||
case Direction.South:
|
||||
return Direction.North;
|
||||
|
||||
case Direction.Down:
|
||||
return Direction.Up;
|
||||
case Direction.Up:
|
||||
return Direction.Down;
|
||||
default:
|
||||
return Direction.Up;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue