public enum Direction extends java.lang.Enum<Direction>
Angles are represented as an int value ranging from 0-2047, where the following is true:
Enum Constant and Description |
---|
EAST
Angles ranging from 1408 - 1663.
|
NORTH
Angles ranging from 896 - 1151.
|
NORTH_EAST
Angles ranging from 1152 - 1407.
|
NORTH_WEST
Angles ranging from 640 - 895.
|
SOUTH
Angles ranging from 0 - 127 and 1920 - 2047.
|
SOUTH_EAST
Angles ranging from 1664 - 1919.
|
SOUTH_WEST
Angles ranging from 128 - 383.
|
WEST
Angles ranging from 384 - 639.
|
Modifier and Type | Method and Description |
---|---|
static Direction |
get(int angle)
Converts the angle value to the nearest cardinal direction.
|
static int |
getAngleTo(Locatable origin,
Locatable locatable) |
static int |
getAngleToDeg(Locatable origin,
Locatable locatable) |
static Direction |
getDirectionTo(Locatable origin,
Locatable locatable) |
static int |
toDegrees(int angle) |
static int |
toRS(int degrees) |
static Direction |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Direction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Direction SOUTH
public static final Direction SOUTH_WEST
public static final Direction WEST
public static final Direction NORTH_WEST
public static final Direction NORTH
public static final Direction NORTH_EAST
public static final Direction EAST
public static final Direction SOUTH_EAST
public static Direction[] values()
for (Direction c : Direction.values()) System.out.println(c);
public static Direction valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static Direction get(int angle)
Each cardinal direction contains 256 angles, ranging between -128 and +128 of it's true value. Negative values and values above 2047 are wrapped accordingly
angle
- the RS anglepublic static int toRS(int degrees)
public static int toDegrees(int angle)