Table of Contents

Class: Room mudlib/room.py

Rooms are where people live and play.

Rooms provide the crux of the MUD world. Rooms are where players and NPC's exist. Like all other objects, they have long and short descriptions and, like containers, they house other objects. In addition, rooms support exits and doors through which interactives can move, and provide some utility methods to make some tasks (such as NPC regeneration and management) easier.

Base Classes   
core.Container
Methods   
addDoor
addExit
addNPC
createContainer
createRoom
destroyContainer
destroyRoom
enterContainer
enterRoom
getDoor
getExitNames
getExits
getLongDescription
leaveContainer
leaveRoom
refreshContainer
refreshRoom
removeDoor
removeExit
tellRoom
  addDoor 
addDoor ( self,  door )

Adds a door object to this room.

  addExit 
addExit (
        self,
        exitName,
        destinationRoom,
        )

Add an exit to this room.

The exit name is what interactives will see and need to type to move through the exit. The destination room should be the python path to the room, NOT a reference to a room object!

  addNPC 
addNPC ( self,  pythonPath )

Add an NPC to this room.

This is a utility method that can be used to easily add NPC's to rooms. Simply provide the python path to the desired class and this method will take care of cloning and moving the NPC to this room. It will also regenerate the NPC at refresh if it has been slain.

  createContainer 
createContainer ( self )

Overrides core.Container.createContainer. Do NOT override!

If you want to perform some initilization, you should override the createRoom method.

  createRoom 
createRoom ( self )

The "constructor" for rooms.

This method should be overriden, if necessary, and any initialization put in the overriden version. Note that you should NOT override the __init__, createObject, or createContainer methods.

  destroyContainer 
destroyContainer ( self )

Overrides core.Container.destroyContainer. Do NOT override!

This version performs any room-specific cleanup. If you need to perform your own cleanup, you should override the destroyRoom method.

  destroyRoom 
destroyRoom ( self )

Invoked during room destruction.

This method is invoked by the destroyContainer method after any room-specific cleanup has occured. If you need to perform your own cleanup, you should override this method.

  enterContainer 
enterContainer ( self,  newObject )

Overrides core.Container.enterContainer. Do NOT override!

This version takes care of adding the proper actions to interactives so that they can use the exits. If you're interested in being notified when objects enter this room, you should override the enterRoom method.

  enterRoom 
enterRoom ( self,  newObject )

Invoked when an object enters this room.

This method is invoked by the enterContainer method when an object has entered the room. If you're interested in being notified when objects enter this room, you should override this method.

  getDoor 
getDoor ( self,  exitName )

Retrieve the door that is hinged over the given exit name.

  getExitNames 
getExitNames ( self )

Retrieve the names of all of the exits in this room.

  getExits 
getExits ( self )

Retrieve the mapping of all exits in this room.

  getLongDescription 
getLongDescription ( self )

Overrides core.Container.getLongDescription.

This version appends a description of doors and exits to the long description

  leaveContainer 
leaveContainer ( self,  oldObject )

Overrides core.Container.leaveContainer. Do NOT override!

This version takes care of removing any actions added to an interactive to enable movement through exits. If you're interested in being notified when objects leave this room, you should override the leaveRoom method.

  leaveRoom 
leaveRoom ( self,  oldObject )

Invoked when an object leaves this room.

This method is invoked by the leaveContainer method when an object leaves this room. If you're interested in being notified when objects leave this room, you should override this method.

  refreshContainer 
refreshContainer ( self )

Overrides core.Container.refreshContainer. Do NOT override!

Performs any necessary room-specific refreshment, including the regeneration of slain NPC's managed by this room, and then invokes the refreshRoom method. If you need to perform any refreshment, you should override the refreshRoom method.

  refreshRoom 
refreshRoom ( self )

Invoked during room refreshment.

This method is invoked by the refreshContainer method after any room-specific refreshment has been performed. If you need to perform any refreshment, you should override this method.

  removeDoor 
removeDoor ( self,  exitName )

Removes the door from this room hinged over the given exit name.

  removeExit 
removeExit ( self,  exitName )

Remove the exit from this room with the given name.

When you remove an exit from a room, it also removes the ability for players to go through that exit--though that may seem obvious.

  tellRoom 
tellRoom (
        self,
        gaggedInteractives,
        *message,
        )

Sends a message to interactives in this room.

If you do not wish the message to be displayed to certain interactives, you can include them in the list of gaggedInteractives. The message can be one or more strings or VBFCs.


Table of Contents

This document was automatically generated on Thu Jan 24 08:57:43 2002 by HappyDoc version 2.0