Ex. 6.44: Add locked exits to your game. The player needs to find (or otherwise obtain) a key to unlock the exit and enter a room. (You don't need to add a new class for doors or exits to your game). Make this as general as possible - in any room, any exit could potentially be locked.
I have no idea how to do this. One idea was to make a HashMap with direction as keys and boolean (true/false) as values. Any suggestions?