[Home] [Groups] - Message: [Prev in Group] [Next in Group]
28416: RE: [MUD-Dev] Class hierarchies for objects
[Full Header] [Plain Text]
From: "Bo Zimmerman" <bo@zimmers.net>
Newsgroups: nu.kanga.list.mud-dev
Date: Thu, 18 Sep 2003 14:10:15 -0500
References: [1]
Organization: Kanga.Nu
From: Brian Hook
> I'm doing some research into property and object systems and I'd
> like to get a feel for what real life class hierarchies (not
> necessarily C++ hierarchies, but anything that uses some kind of
> inheritance mechanism) look like for NPCs, monsters, weapons,
> rooms, shops, etc. Does anyone have pointers to papers or docs
> that discuss the various implementations out there?
I don't know about a comparative, but here the CoffeeMud system
(java) has an Environmental as the base interface for the things you
describe. The Environmental interface extends my Tickable,
MsgListener, and StatsAffecting interfaces. Environmental is
extended by Item, MOB, Exit, and Room. Weapon, Armor, Wands,
Potions, Pills all extend Item. There are seperate and distinct
interfaces for things like Drinkables and ShopKeepers, since a Room
or a MOB may be Drinkable, etc.
In CM, the difference between an NPC and a player is just whether
the MOB returns anything from its session() method. In other words,
if there is a telnet session attached to the mob, it's a player.
Otherwise, it is not. Making a seperate class interface for players
and NPCs would have hemmed me in too many times otherwise.
- Bo
_______________________________________________
MUD-Dev mailing list
MUD-Dev@kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev