Initially I was going to use a separate Map class to manage/track where room features (wumpus, player, pits, bats) occur in the cave. This class would've contained a reference to its corresponding Cave object. However, each room of the cave also needs to know if it contains a feature and which feature it contains (to enable game control and user interface to communicate directly with a room object). This means having to track room features in both the Room and Map classes.
The way I'm planning on taking care of this is by doing away with Map entirely and just having room-feature booleans in each room, and public references to the rooms that contain features (e.g. "public static Room locationWumpus;") in Cave. Does this sound good?
Initially I was going to use a separate Map class to manage/track where room features (wumpus, player, pits, bats) occur in the cave. This class would've contained a reference to its corresponding Cave object. However, each room of the cave also needs to know if it contains a feature and which feature it contains (to enable game control and user interface to communicate directly with a room object). This means having to track room features in both the Room and Map classes. The way I'm planning on taking care of this is by doing away with Map entirely and just having room-feature booleans in each room, and public references to the rooms that contain features (e.g. "public static Room locationWumpus;") in Cave. Does this sound good?