student.adventure
Class GoCommand

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

public class GoCommand
extends Command

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

Version:
1.0 (December 2002)
Author:
Michael Kolling

Constructor Summary
GoCommand()
          Constructor for objects of class GoCommand
 
Method Summary
 boolean execute(Player player)
          Try to go to one direction.
 
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

GoCommand

public GoCommand()
Constructor for objects of class GoCommand

Method Detail

execute

public boolean execute(Player player)
Try to go to one direction. If there is an exit, enter the new room, otherwise print an error message. Returns always 'false'.

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