student.adventure
Class HelpCommand

java.lang.Object
  extended by student.adventure.Command
      extended by student.adventure.HelpCommand

public class HelpCommand
extends Command

Implementation of the 'help' user command for adventure games.

Version:
1.0 (December 2002)
Author:
Michael Kolling

Constructor Summary
HelpCommand(CommandWords words)
          Constructor for objects of class HelpCommand
 
Method Summary
 boolean execute(Player player)
          Print out some help information.
 java.lang.String message()
          Get the descriptive message that is presented before the list of commands when this command is executed.
 
Methods inherited from class student.adventure.Command
getSecondWord, hasSecondWord, setSecondWord
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelpCommand

public HelpCommand(CommandWords words)
Constructor for objects of class HelpCommand

Parameters:
words - The set of words to print help for
Method Detail

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 java.lang.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