|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.strangelight.misc.hex.HexDirection
One of the six points on our hexagonal compass.
Because there are only six possible directions -- and hence no
need for more than six distinct HexDirection objects, there is
no public constructor. Rather, one "constructs" a HexDirection
object simply by assigning or cloning one of these constants
(public static final fields):
HexDirection.N
,
HexDirection.NE
,
HexDirection.SE
,
HexDirection.S
,
HexDirection.SW
,
HexDirection.NW
.
For example, one could "construct" a HexDirection object which pointed north-west like so:
HexDirection nw_pointing_object = HexDirection.NW;
Field Summary | |
static HexDirection |
N
A HexDirection object representing NORTH. |
static HexDirection |
NE
A HexDirection object representing NORTH-EAST. |
static HexDirection |
NW
A HexDirection object representing NORTH-WEST. |
static HexDirection |
S
A HexDirection object representing SOUTH. |
static HexDirection |
SE
A HexDirection object representing SOUTH-EAST. |
static HexDirection |
SW
A HexDirection object representing SOUTH-WEST. |
Constructor Summary | |
protected |
HexDirection()
|
Method Summary | |
static void |
_test_class()
|
boolean |
equals(HexDirection x)
|
HexDirection |
get_rotated(int steps_clockwise)
Get the HexDirection obtained by rotating this HexDirection in 60-degree increments. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final HexDirection N
public static final HexDirection NE
public static final HexDirection SE
public static final HexDirection S
public static final HexDirection SW
public static final HexDirection NW
Constructor Detail |
protected HexDirection()
Method Detail |
public boolean equals(HexDirection x)
public HexDirection get_rotated(int steps_clockwise)
steps_clockwise
- The returned HexDirection will be
obtained by rotating this HexDirection object (60 *
steps_clockwise)
degrees clockwise. Negative numbers
will cause counter-clockwise rotation, as expected.
(60 * steps_clockwise)
degrees clockwise.public static void _test_class() throws java.lang.Exception
java.lang.Exception
_Testable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |