Class CommandWords

java.lang.Object
  extended by CommandWords

public class CommandWords
extends java.lang.Object

This class is the main class of the "World of Zuul" application. "World of Zuul" is a very simple, text based adventure game. This class holds a collection of all command words known to the game. It is used to recognise commands as they are typed in.

Version:
2011.07.31
Author:
Michael Kolling and David J. Barnes

Field Summary
private  java.util.HashMap<java.lang.String,Command> commands
           
 
Constructor Summary
CommandWords()
          Constructor - initialise the command words.
 
Method Summary
 Command get(java.lang.String word)
          Given a command word, find and return the matching command object.
 void showAll()
          Print all valid commands to System.out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commands

private java.util.HashMap<java.lang.String,Command> commands
Constructor Detail

CommandWords

public CommandWords()
Constructor - initialise the command words.

Method Detail

get

public Command get(java.lang.String word)
Given a command word, find and return the matching command object. Return null if there is no command with this name.


showAll

public void showAll()
Print all valid commands to System.out.