RV> How do I link all those structures to reflect in the
RV> player inventory? Do I use a union?
You could, if the player is to have multiple instances of
some objects. An object list would need to know what type of
object is being stored, though. An equipment list, on the
other hand, should be coded into the player object, and
include the possibility of absence of individual items of
equipment, such as no shield, or no wands. A list of each
individual item type coded into the character object may
serve you better and be simpler to handle.
I gravitate toward making an object type, such as weapon,
and having its attributes change according to type.
Then you can have lists of like-type objects and limit the
extent of associated confusion. The objects may be derived
from a base class.
> ] You're trying to make me paranoid, but I'm on to your tricks
---
---------------
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
|