public enum Direction extends java.lang.Enum<Direction>
Notes:
Roads.Bow
objects need, in their field Roads.possibleWays
,
two of these directions;Roads.Cross
objetcs need, in thei fiel Roads.possibleWays
,
at least two of these directions.Enum Constant and Description |
---|
E
Represents the East direction.
|
ENVIRONMENT
Default direction for the
EnvTile tiles. |
N
Represents the North direction.
|
NE
Represents the NorthEast direction.
|
NW
Represents the NorthWest direction.
|
S
Represents the South direction.
|
SE
Represents the SouthEast direction.
|
SW
Represents the SouthWest direction.
|
W
Represents the West direction.
|
Modifier and Type | Method and Description |
---|---|
static Direction |
getContrary(Direction way)
Returns the opposite direction respect to that given.
|
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.
|
static java.lang.Integer |
wayToNumber(Direction way)
Trasforms a Direction to a number.
|
public static final Direction W
public static final Direction E
public static final Direction N
public static final Direction S
public static final Direction NW
public static final Direction NE
public static final Direction SE
public static final Direction SW
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 getContrary(Direction way)
way
- direction inputpublic static java.lang.Integer wayToNumber(Direction way)
way
- Direction to be converted