|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<Richtung>
spiel.Richtung
public enum Richtung
Definiert die Richtungen, in denen ein Nachbar eines Feldes auf dem Spielbrett liegt. Sieht man ein Spielbrett als Matrix mit Indizes als int an, dann bedeuten die einzelnen Richtungen folgendes: N = (-1,0) S = (1,0) NW = (-1,-1) SW = (0,-1) NO = (0,1) SO = (1,1) Keiner Richtung entsprechen (0,0), (1,-1) und (-1,1).
Enum Constant Summary | |
---|---|
N
|
|
NO
|
|
NW
|
|
S
|
|
SO
|
|
SW
|
Method Summary | |
---|---|
int |
getDeltaX()
ergibt die x-Differenz für die Richtung |
int |
getDeltaY()
ergibt die y-Differenz für die Richtung |
static Richtung |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Richtung[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final Richtung N
public static final Richtung S
public static final Richtung NW
public static final Richtung SW
public static final Richtung NO
public static final Richtung SO
Method Detail |
---|
public static final Richtung[] values()
for(Richtung c : Richtung.values()) System.out.println(c);
public static Richtung 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 int getDeltaX()
public int getDeltaY()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |