cs1705.adventure
Class HelpCommand
java.lang.Object
cs1705.adventure.Command
cs1705.adventure.HelpCommand
public class HelpCommand
- extends Command
Implementation of the 'help' user command for adventure games.
- Version:
- 1.0 (December 2002)
- Author:
- Michael Kolling
|
Method Summary |
boolean |
execute(Player player)
Print out some help information. |
String |
message()
Get the descriptive message that is presented before
the list of commands when this command is executed. |
HelpCommand
public HelpCommand(CommandWords words)
- Constructor for objects of class HelpCommand
- Parameters:
words - The set of words to print help for
execute
public boolean execute(Player player)
- Print out some help information. Here we print some stupid,
cryptic message and a list of the command words.
Returns always false.
- Specified by:
execute in class Command
- Parameters:
player - The player executing the command
- Returns:
- True, if game should exit; false otherwise.
message
public String message()
- Get the descriptive message that is presented before
the list of commands when this command is executed.
A subclass can override this method to customize the
text printed for the help command.
- Returns:
- the help message as a string
Copyright © 2009 Virginia Tech.