See: Description
Class | Description |
---|---|
Command |
This class is an abstract superclass for all command classes in the game.
|
CommandWords |
This class holds a collection of all command words known to the game.
|
Game |
This class is the main class for a "World of Zuul"-style adventure
game application.
|
GoCommand |
Implementation of the 'go' user command for adventure games.
|
HelpCommand |
Implementation of the 'help' user command for adventure games.
|
Parser |
This parser reads user input and tries to interpret it as an "Adventure"
command.
|
Player |
This class represents a player in an adventure game.
|
QuitCommand |
Implementation of the 'quit' user command for adventure games.
|
Room |
Represents one location in the scenery of an adventure game.
|
This package provides all of the course-specific classes based on the "World of Zuul" adventure game example from Chapter 7 of Objects First with Java by Michael Kolling and David Barnes. These classes support program assignments where students write their own adventure games by adding to and extending these core classes.
The primary differences between the classes in this package and those discussed in the B&K text are:
The Command
objects use polymorphism
(object-oriented dispatch) for controlling execution of
the proper behavior, rather than a series of if statements as in
the textbook (see exercise 7.39 in the text).
The Game
class is abstract, and cannot be
played directly. Instead, one must create a subclass and define
three abstract methods to produce a playable game.
The classes in this package have been designed so that one can implement a game and extend all necessary features by appropriate subclassing and overriding. As a result, these classes are distributed in binary form only. This contrasts with the scenario in the text, where students directly modify the source code of these classes.