|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcs1705.adventure.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()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CommandWords()
| Method Detail |
public void addCommand(String word,
Command command)
word - the word for this commandcommand - the associated command object implementing
this commandpublic Command get(String word)
public void showAll()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||