cs1705.adventure
Class GoCommand
java.lang.Object
cs1705.adventure.Command
cs1705.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. |
GoCommand
public GoCommand()
- Constructor for objects of class GoCommand
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.