Multiple instances of the same object.
Hm. I guess this could go on the main programming board, but my reasons for doing it are more clear over HERE, because it is game related.
I'm hunting the elusive beast known as the wumpus.
I'm also in the process of making a text-based RPG. Or rather, planning one out and learning HOW to make one, because the odds of me actually making it aren't really HIGH.
Anyway, I want to have multiple instances of the same object.
* For items in the INVENTORY, I could just apply a simple in_inventory counter to the object.
* However, let's say I have two objects in my world, in seperate rooms. I can't create a linked list and put the object in two seperate ones, or I break my next/previous pointers. Furthermore, if the objects are in the same room, the same thing ensues.
* Someone mentioned using an enum or an array to handle this. However, I think at some point I'll have to derive new classes from original ones to specify SPECIAL OBJECTS that do NONSTANDARD THINGS, and hence I couldn't store them in a single item enum or item array. I'd actually probably use a vector. Same principle.
* Someone suggested just using a massive switch/case statement as a member of each class, so that I wouldn't have to derive anything. This sounds sort of bloated an akward, though.
* would using the STL list class alleviate all of my problems? I mean, with this program. I don't expect them to regrow my hair or give me an extra 1-2 inches. Not... that I'm bald, or... a guy. Er. Ahem. Moving on.
* Could I use DMA to create new objects and handle it this way?