student.adventure
Class QuitCommand

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

public class QuitCommand
extends Command

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

Version:
1.0 (December 2002)
Author:
Michael Kolling

Constructor Summary
QuitCommand()
          Constructor for objects of class QuitCommand
 
Method Summary
 boolean execute(Player player)
          "Quit" was entered.
 
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

QuitCommand

public QuitCommand()
Constructor for objects of class QuitCommand

Method Detail

execute

public boolean execute(Player player)
"Quit" was entered. Check the argument to see whether we really quit the game. Return true, if we should quit, false otherwise.

Specified by:
execute in class Command
Parameters:
player - The player executing the command
Returns:
True, if game should exit; false otherwise.