FileDocCategorySizeDatePackage
Cmd.javaAPI DocExample875Sun Mar 16 15:12:14 GMT 2003metrolib

Cmd

public class Cmd extends Object

Fields Summary
public static final int
HELP
public static final int
NORTH
public static final int
EAST
public static final int
SOUTH
public static final int
WEST
public static final int
QUIT
public static final int
UNKNOWN
Constructors Summary
Methods Summary
public static intparseCmd(java.lang.String line)


	     
		if (line == null || line.equals("q") ||
			line.equalsIgnoreCase("quit"))
			return QUIT;
		if (line.equals("n") || line.equalsIgnoreCase("north"))
			return NORTH;
		if (line.equals("e") || line.equalsIgnoreCase("east"))
			return EAST;
		if (line.equals("s") || line.equalsIgnoreCase("south"))
			return SOUTH;
		if (line.equals("w") || line.equalsIgnoreCase("west"))
			return WEST;

		if (line.equals("h") || line.equals("?") ||
			line.equalsIgnoreCase("help"))
			return HELP;

		// more later...

		return UNKNOWN;