wyvern.common.tiles
Class Directions

java.lang.Object
  extended bywyvern.common.tiles.Directions

public class Directions
extends java.lang.Object

Common constants for finding directional images - used by client and server.

Version:
1.0, Feb 06, 2003
Author:
Steve Yegge

Field Summary
static int DOWN
           
static int E
           
static int EAST
           
static int ILLEGAL_DIR
           
static int N
           
static int NE
           
static int NONE
           
static int NORTH
           
static int NW
           
static int S
           
static int SE
           
static int SOUTH
           
static int SW
           
static int UP
           
static int W
           
static int WEST
           
 
Constructor Summary
Directions()
           
 
Method Summary
protected static void createDirectionTables()
          Establishes all the direction commands we recognize, for checking the arguments to "move" or "go".
static int parseDirection(java.lang.String dir)
          Figures out what direction the user specified from the string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ILLEGAL_DIR

public static final int ILLEGAL_DIR
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values

N

public static final int N
See Also:
Constant Field Values

NORTH

public static final int NORTH
See Also:
Constant Field Values

S

public static final int S
See Also:
Constant Field Values

SOUTH

public static final int SOUTH
See Also:
Constant Field Values

E

public static final int E
See Also:
Constant Field Values

EAST

public static final int EAST
See Also:
Constant Field Values

W

public static final int W
See Also:
Constant Field Values

WEST

public static final int WEST
See Also:
Constant Field Values

NE

public static final int NE
See Also:
Constant Field Values

NW

public static final int NW
See Also:
Constant Field Values

SE

public static final int SE
See Also:
Constant Field Values

SW

public static final int SW
See Also:
Constant Field Values

UP

public static final int UP
See Also:
Constant Field Values

DOWN

public static final int DOWN
See Also:
Constant Field Values
Constructor Detail

Directions

public Directions()
Method Detail

createDirectionTables

protected static void createDirectionTables()
Establishes all the direction commands we recognize, for checking the arguments to "move" or "go".


parseDirection

public static int parseDirection(java.lang.String dir)
Figures out what direction the user specified from the string.

Parameters:
dir - a string (e.g. "northwest", "left", "s", "down" )
Returns:
a Direction constant (Direction.NW, Direction.W, ...) Returns Direction.ILLEGAL_DIR if the string couldn't be parsed