POO Library

$pub.rooms.exitLister

This is a type of room that lists its exits.
"Creating exitLister (a room that lists its exits)"
@create $place as exitLister
@newfunc exitLister.description(self,looker)
# first, get the room name and the standard description
desc = super(looker) + "\n   Exits:\n"
# then add a list of exits
cnt = 0
for item in self.contents():
    if callable(item.invoke) and type(item.dest)==InstanceType:
        desc = desc + "       %-6s -- %s\n" \
            % (item.name, item.dest.name)
        cnt = cnt + 1
if not cnt: desc = desc + "       (None)\n"
return desc
.x
@set exitLister.f = 1
beam exitLister to $pub.rooms


Usage

If you're creating new rooms by hand (rather than using @dig), you can simply derive them from $pub.rooms.exitLister instead of $place (which is the same as $pub.rooms.place). To change existing rooms, just use the following command:
    @set here.parents = $pub.rooms.exitLister


http://www.strout.net/python/poo/lib/exitLister.html
Last Updated: 6/07/97 . . . . . . Joe Strout