|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<Direction>
jurpe.dungeon.crawler.Direction
public enum Direction
Direction helper class. Incapsulates direction info as an integer value.
Enum Constant Summary | |
---|---|
NORTH
|
|
NORTHEAST
|
|
NORTHWEST
|
|
SOUTH
|
|
SOUTHEAST
|
|
SOUTHWEST
|
Method Summary | |
---|---|
static Direction |
fromString(java.lang.String str)
Get a direction from a string. |
static Direction |
fromValue(short x)
Return a direction from a given value |
static Direction |
getInverse(Direction d)
Get the inverse direction (ie: North->South, SouthWest->NorthEast) |
static Direction |
getRandom(java.util.Random rnd)
Get a random direction |
short |
getValue()
Get the value of this direction |
java.lang.String |
toString()
To string |
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're declared. |
Methods inherited from class java.lang.Enum |
---|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final Direction NORTH
public static final Direction NORTHEAST
public static final Direction SOUTHEAST
public static final Direction SOUTH
public static final Direction SOUTHWEST
public static final Direction NORTHWEST
Method Detail |
---|
public static final 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 namepublic static Direction getRandom(java.util.Random rnd) throws JurpeException
rnd
- Random seed
JurpeException
public static Direction fromString(java.lang.String str)
str
- Can be North,South,NorthEast,NorthWest,SouthEast,SouthWest.
public static Direction fromValue(short x) throws JurpeException
x
- 0=N,1=NE,2=SE,3=S,4=SW,5=NW
JurpeException
public static Direction getInverse(Direction d)
d
- Direction to be inverted
public java.lang.String toString()
toString
in class java.lang.Enum<Direction>
public short getValue()
|
Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |