com.threerings.tudey.util
Enum Direction

java.lang.Object
  extended by java.lang.Enum<Direction>
      extended by com.threerings.tudey.util.Direction
All Implemented Interfaces:
Serializable, Comparable<Direction>

public enum Direction
extends Enum<Direction>

Represents the four cardinal and four ordinal directions and their offsets in the Tudey coordinate system.


Enum Constant Summary
EAST
           
NORTH
           
NORTHEAST
           
NORTHWEST
           
SOUTH
           
SOUTHEAST
           
SOUTHWEST
           
WEST
           
 
Field Summary
static Direction[] CARDINAL_VALUES
          The cardinal directions.
 
Method Summary
 int getX()
          Returns the x offset corresponding to the direction.
 int getY()
          Returns the y offset corresponding to the direction.
static Direction valueOf(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.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NORTH

public static final Direction NORTH

NORTHWEST

public static final Direction NORTHWEST

WEST

public static final Direction WEST

SOUTHWEST

public static final Direction SOUTHWEST

SOUTH

public static final Direction SOUTH

SOUTHEAST

public static final Direction SOUTHEAST

EAST

public static final Direction EAST

NORTHEAST

public static final Direction NORTHEAST
Field Detail

CARDINAL_VALUES

public static final Direction[] CARDINAL_VALUES
The cardinal directions.

Method Detail

values

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

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

valueOf

public static Direction valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getX

public int getX()
Returns the x offset corresponding to the direction.


getY

public int getY()
Returns the y offset corresponding to the direction.



Copyright © 2011. All Rights Reserved.