|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<Map.Direction>
net.sf.freecol.common.model.Map.Direction
public static enum Map.Direction
The directions a Unit can move to. Includes deltas for moving to adjacent squares, which are required due to the isometric map. Starting north and going clockwise.
Enum Constant Summary | |
---|---|
E
|
|
N
|
|
NE
|
|
NW
|
|
S
|
|
SE
|
|
SW
|
|
W
|
Field Summary | |
---|---|
static Map.Direction[] |
longSides
|
Method Summary | |
---|---|
int |
getEvenDX()
|
int |
getEvenDY()
|
Map.Direction |
getNextDirection()
|
int |
getOddDX()
|
int |
getOddDY()
|
Map.Direction |
getPreviousDirection()
|
static Map.Direction |
getRandomDirection(java.util.Random random)
Returns a random Direction. |
static Map.Direction[] |
getRandomDirectionArray(java.util.Random random)
Creates an array of the eight directions in a random order. |
Map.Direction |
getReverseDirection()
Returns the reverse direction of the given direction. |
static Map.Direction |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Map.Direction[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final Map.Direction N
public static final Map.Direction NE
public static final Map.Direction E
public static final Map.Direction SE
public static final Map.Direction S
public static final Map.Direction SW
public static final Map.Direction W
public static final Map.Direction NW
Field Detail |
---|
public static final Map.Direction[] longSides
Method Detail |
---|
public static Map.Direction[] values()
for (Map.Direction c : Map.Direction.values()) System.out.println(c);
public static Map.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 name
java.lang.NullPointerException
- if the argument is nullpublic int getOddDX()
public int getOddDY()
public int getEvenDX()
public int getEvenDY()
public Map.Direction getNextDirection()
public Map.Direction getPreviousDirection()
public Map.Direction getReverseDirection()
public static Map.Direction getRandomDirection(java.util.Random random)
random
- A Random
number source.
Direction
valuepublic static Map.Direction[] getRandomDirectionArray(java.util.Random random)
random
- A Random
number source.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |