|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.aranai.dungeonator.Direction
public final class Direction
Specifies byte values for the 12 cardinal directions, starting at 0 for North and proceeding clockwise. Also includes convenience arrays and functions for determining side from direction, directions from side, and computing rotations.
Field Summary | |
---|---|
static byte[] |
CARDINALS
Cardinal Directions |
static byte |
CLOCKWISE
Clockwise Direction Sequence |
static byte |
COUNTER_CLOCKWISE
Counter-Clockwise Direction Sequence |
static byte |
E
East |
static byte |
ENE
East by Northeast |
static byte |
ESE
East by Southeast |
static byte |
N
North |
static byte |
NNE
North by Northeast |
static byte |
NNW
North by Northwest |
static byte |
S
South |
static byte[] |
SIDE_EAST
East Side Directions |
static byte[] |
SIDE_NORTH
North Side Directions |
static byte[] |
SIDE_SOUTH
South Side Directions |
static byte[] |
SIDE_WEST
West Side Directions |
static byte |
SSE
South by Southeast |
static byte |
SSW
South by Southwest |
static byte |
W
West |
static byte |
WNW
West by Northwest |
static byte |
WSW
West by Southwest |
Constructor Summary | |
---|---|
Direction()
|
Method Summary | |
---|---|
static byte[] |
getSideFromDirection(byte direction)
Gets the side to which the specified direction belongs. |
static byte |
rotate(byte start,
byte direction,
int advance)
Return a direction rotated a specified number of steps, either clockwise or counterclockwise, from a specified starting direction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static byte N
public static byte E
public static byte S
public static byte W
public static byte NNE
public static byte ENE
public static byte ESE
public static byte SSE
public static byte SSW
public static byte WSW
public static byte WNW
public static byte NNW
public static byte[] SIDE_NORTH
public static byte[] SIDE_EAST
public static byte[] SIDE_SOUTH
public static byte[] SIDE_WEST
public static byte[] CARDINALS
public static byte CLOCKWISE
public static byte COUNTER_CLOCKWISE
Constructor Detail |
---|
public Direction()
Method Detail |
---|
public static byte[] getSideFromDirection(byte direction)
direction
- the direction
public static byte rotate(byte start, byte direction, int advance)
start
- the starting directiondirection
- the direction to rotateadvance
- the number of steps to advance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |