|
|||||||||
| 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[] |
corners
|
private int |
evenDX
|
private int |
evenDY
|
static Map.Direction[] |
longSides
|
static int |
NUMBER_OF_DIRECTIONS
|
private int |
oddDX
|
private int |
oddDY
|
| Method Summary | |
|---|---|
Map.Direction[] |
getClosestDirections(java.lang.String logMe,
java.util.Random random)
Creates an array of the directions in an order that favours a supplied one. |
int |
getEvenDX()
|
int |
getEvenDY()
|
java.lang.String |
getNameKey()
|
Map.Direction |
getNextDirection()
Get the next direction after this one (clockwise). |
int |
getOddDX()
|
int |
getOddDY()
|
Map.Direction |
getPreviousDirection()
Get the previous direction after this one (anticlockwise). |
static Map.Direction |
getRandomDirection(java.lang.String logMe,
java.util.Random random)
Gets a random Direction. |
static Map.Direction[] |
getRandomDirections(java.lang.String logMe,
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. |
private Map.Direction |
rotate(int n)
Gets this direction rotated by n places. |
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 |
|---|
clone, compareTo, equals, finalize, 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 int NUMBER_OF_DIRECTIONS
public static final Map.Direction[] longSides
public static final Map.Direction[] corners
private int oddDX
private int oddDY
private int evenDX
private int evenDY
| 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()
private Map.Direction rotate(int n)
n - The number of places to rotate.
public Map.Direction getNextDirection()
Direction.public Map.Direction getPreviousDirection()
Direction.public Map.Direction getReverseDirection()
Direction.public java.lang.String getNameKey()
public static Map.Direction getRandomDirection(java.lang.String logMe,
java.util.Random random)
logMe - A string to log with the random results.random - A Random number source.
Direction value.
public static Map.Direction[] getRandomDirections(java.lang.String logMe,
java.util.Random random)
logMe - A string to log with the random results.random - A Random number source.
Directions in a random order.
public Map.Direction[] getClosestDirections(java.lang.String logMe,
java.util.Random random)
logMe - A string to log with the random results.random - A Random number source.
Directions favouring this one.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | ||||||||