After nearly killing myself shoveling the SIX INCHES OF SLUSH off of my driveway, I got about 90 minutes of work on Adventure Maker done, so I'm at least happy about that.
I came up with, I think, a halfway decent way of getting one portion of the game entities in contact with another portion, by having everything contain a link to it's parent.
The reason this came up is because my Lock objects, which are contained in a Locks collection object, which is contained within an Adventure object, which holds the whole thing (so, Adventure contains Locks contains Lock) has to link to an Item, but only does so by array index (Item is in Items is in Adventure).
So now a Lock has a link to Locks, Locks has a link to Adventure, and similarly for Item and Items, so I can navigate up the tree from a Lock object to access the Item used to unlock it (so that I can print the name).
Why did this need to be done?
Each entity and entity collection has an Edit function, which runs an input loop to edit the entity or collection (or exit to higher in the tree). Most of the functionality is handled in the base classes, and only a few minor things that customize the experience are handled at the entity or collection level.
Why not just have a link directly to the object in question?
Mainly, because that's not how it was done when I originally made this game. Everything was array indices. In a way, however, this helps somewhat with the XML save/load problem.
XML is really great for hierarchical information, but lousy for relational information, which the Adventure object is. Locks link to Items. Rooms link to Monsters, and contain Directions which link to Doors, Locks, Items, Traps, and other Rooms and Epilogues.
So, having everthing kept track of by array index makes the XML doable, and I don't have to have a string "id" tag, which would then require a Dictionary object, and so on and so forth. Simpler just to have a number.
But what if the number is out of the bounds of the array indices?
That's an easy one. Those are treated as null.
So that's progress. Soon, I have to make some dinner, but now I have to put up some shades.