Class GoCommand

java.lang.Object
  extended by Command
      extended by GoCommand

public class GoCommand
extends Command

Implementation of the 'go' user command.

Version:
2011.07.31
Author:
Michael Kolling and David J. Barnes

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 Command
getSecondWord, hasSecondWord, setSecondWord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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
Returns:
True, if game should exit; false otherwise.