|
CS 1705 Library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcs1705.adventure.CommandWords
public class CommandWords
This class holds a collection of all command words known to the game. It is used to recognise commands as they are typed in. It is part of the "World of Zuul" application, a very simple text-based adventure game.
| Constructor Summary | |
|---|---|
CommandWords()
Constructor - initialise the command words. |
|
| Method Summary | |
|---|---|
void |
addCommand(String word,
Command command)
Add (or replace) a command word. |
Command |
get(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 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandWords()
| Method Detail |
|---|
public Command get(String word)
word - The word to look up
public void addCommand(String word,
Command command)
word - the word for this commandcommand - the associated command object implementing
this commandpublic void showAll()
|
Last updated: Wed, Apr 1, 2009 12:29 AM EDT | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||