Red-black trees
We will add the StoneRoom class to Zuul. The desired behavior is described in lab 7. Our edible will be a cookie, and we will not create a special class for them.
The general respond() logic is as follows:
if the command is "eat cookie":
make sure the user has the cookie
if so, remove the cookie from the inventory
say something about new energy
set just_eaten = true
if the command is "move stone":
if not just_eaten, it's too heavy
if stone is already moved, say so
add a JEWEL
update the room's description (note the use of the
constructor altdesc here)
Note that all the work is in class StoneRoom, except for two lines to create the room in RoomMaker.cs. We don't have to change the existing game logic.
I want the effect of eating the cookie to last only a single turn. Notice how I can handle this in StoneRoom.Respond().