[MUD-Dev] Class hierarchies for objects

Bo Zimmerman bo at zimmers.net
Thu Sep 18 14:10:15 CEST 2003


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 at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list