The goal of this lab is to work the game code into a working version of the current plan, tweaking the design as necessary.
First you should have your UML diagrams ready for the sections of code you were working on. We will compare and disucss them. Then we'll proceed to modify the code.
Here's what needs to be done:
PickupCommand
class needs to be written.
This command should add the item to the player's inventory, or
something equivalent.
GoCommand
class (or something equivalent) needs
to be written.
This command should refer to a door of the room and change
the current room of the game.
Item
class should have an
abstract method getCommand()
which the
parser will use to populate its hashmap with command objects
based on the items in the room.
A Door
would return a GoCommand
,
and a PortableItem
would return a PickupCommand
.
LookCommand
class needs to be fixed
based on changes made to Room
.
I do not believe that Room
still has north/west/east/
south distinctions, but simply a set of doors.
SimpleGame
(or other test cases)
to test out the projet (and make it fun).
Goal: Have a compilable, working version by the end of lab.