On 1/19/98 3:04 PM, Patrick J. Dughi (dughi@IMAXX.NET) stated: > Anyway, I thought a great solution would be to place the three >main data groups (room_data, obj_data, char_data) into a single structure, >add a switch to choose which data type it actually is, and then using that >for special cases, treat everything bascially the same. So, you could >mount a flying carpet, or have a talking room,, or a fighting sword, or, >well, a slew of interesting things. Add it up with a script system that >is generic at user level, which differentiates between object types at the >level at which it becomes important, and you're all set for something >that's at least interesting... > > Any thoughts? Not really practical... although it is done already with LPC based MUDs (sort of). The 3 "basic types" are not as basic as they might seem... rather they are base classes to the various versions. Rooms could not be treated like characters/objects in any way... you can't hold a room, put a room in a room, hit a room, damage a room (well, maybe somethng like that), or move a room. Rooms are really the meta-containers, which contain two other containers: characters and objects. Characters have two sub-classes: mobs and players, which have their own appropriate data. Objects are a parent class to all the different item types available. It would be like trying to make an abstract class to represent a microphone, a computer, and a tire. The best you could do is make it "physical mass", and have some basic qualities to assign to it, but when it comes down to the many differentiations, those basic qualities aren't going to matter when there are more use-specific qualities available. Besides, imagine the mess of code you would have... probably best to just go C++ with those 3 classes... on my MUD, obj_to_room has become member to_room of ObjData... if I were to make a meta class that all 3 primary classes would inherit from, it would at most contain memory management and the "id" member, which is the only member in common. - Chris Jacobson +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST