2018-07-06 15:30:00 +02:00
|
|
|
package com.eu.habbo.habbohotel.rooms;
|
|
|
|
|
2018-07-08 23:32:00 +02:00
|
|
|
|
2018-07-06 15:30:00 +02:00
|
|
|
public enum RoomUserRotation {
|
|
|
|
NORTH(0),
|
|
|
|
NORTH_EAST(1),
|
|
|
|
EAST(2),
|
|
|
|
SOUTH_EAST(3),
|
|
|
|
SOUTH(4),
|
|
|
|
SOUTH_WEST(5),
|
|
|
|
WEST(6),
|
|
|
|
NORTH_WEST(7);
|
|
|
|
|
|
|
|
private final int direction;
|
|
|
|
|
|
|
|
RoomUserRotation(int direction)
|
|
|
|
{
|
|
|
|
this.direction = direction;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getValue()
|
|
|
|
{
|
|
|
|
return this.direction;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static RoomUserRotation fromValue(int rotation)
|
|
|
|
{
|
|
|
|
rotation %= 8;
|
|
|
|
for (RoomUserRotation rot : values())
|
|
|
|
{
|
|
|
|
if (rot.getValue() == rotation)
|
|
|
|
{
|
|
|
|
return rot;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NORTH;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static RoomUserRotation counterClockwise(RoomUserRotation rotation)
|
|
|
|
{
|
|
|
|
return fromValue(rotation.getValue() + 7);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static RoomUserRotation clockwise(RoomUserRotation rotation)
|
|
|
|
{
|
|
|
|
return fromValue(rotation.getValue() + 9);
|
|
|
|
}
|
|
|
|
}
|