package bunyan.api;

public enum Direction
{
    DOWN(0),
    UP(1),
    NORTH(2),
    SOUTH(3),
    WEST(4),
    EAST(5);
    private final byte value;

    public static Direction fromValue(int var0)
    {
        switch (var0)
        {
            case 0:
                return DOWN;

            case 1:
                return UP;

            case 2:
                return NORTH;

            case 3:
                return SOUTH;

            case 4:
                return WEST;

            case 5:
                return EAST;

            default:
                return null;
        }
    }

    private Direction(int var3)
    {
        this.value = (byte)var3;
    }

    public byte getValue()
    {
        return this.value;
    }

    public Direction leftSide()
    {
        switch (Direction.NamelessClass1027587876.$SwitchMap$bunyan$api$Direction[this.ordinal()])
        {
            case 1:
                return WEST;

            case 2:
                return EAST;

            case 3:
                return SOUTH;

            case 4:
                return NORTH;

            default:
                return this;
        }
    }

    public Direction oppositeSide()
    {
        return fromValue(this.getValue() % 2 == 0 ? this.getValue() + 1 : this.getValue() - 1);
    }

    public Direction rightSide()
    {
        return this != UP && this != DOWN ? this.leftSide().oppositeSide() : this;
    }

    static class NamelessClass1027587876 {
        static final int[] $SwitchMap$bunyan$api$Direction = new int[Direction.values().length];

        static {
            try {
                $SwitchMap$bunyan$api$Direction[Direction.NORTH.ordinal()] = 1;
            }
            catch (NoSuchFieldError var4)
            {
                ;
            }

            try {
                $SwitchMap$bunyan$api$Direction[Direction.SOUTH.ordinal()] = 2;
            }
            catch (NoSuchFieldError var3)
            {
                ;
            }

            try {
                $SwitchMap$bunyan$api$Direction[Direction.WEST.ordinal()] = 3;
            }
            catch (NoSuchFieldError var2)
            {
                ;
            }

            try {
                $SwitchMap$bunyan$api$Direction[Direction.EAST.ordinal()] = 4;
            }
            catch (NoSuchFieldError var1)
            {
                ;
            }
        }
    }
}
