spiel
Enum Richtung

java.lang.Object
  extended by java.lang.Enum<Richtung>
      extended by spiel.Richtung
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Richtung>

public enum Richtung
extends java.lang.Enum<Richtung>
implements java.io.Serializable

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).

Version:
1.2

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

N

public static final Richtung N

S

public static final Richtung S

NW

public static final Richtung NW

SW

public static final Richtung SW

NO

public static final Richtung NO

SO

public static final Richtung SO
Method Detail

values

public static final Richtung[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Richtung c : Richtung.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Richtung valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getDeltaX

public int getDeltaX()
ergibt die x-Differenz für die Richtung


getDeltaY

public int getDeltaY()
ergibt die y-Differenz für die Richtung