Java Reference
In-Depth Information
Example 16−3: Mud.java (continued)
/** Deliver a message to the person */
public void tell(String message) throws RemoteException;
}
/**
* This is the most important remote interface for the MUD. It defines the
* methods exported by the "places" or "rooms" within a MUD. Each place
* has a name and a description, and also maintains a list of "people" in
* the place, things in the place, and exits from the place. There are
* methods to get a list of names for these people, things, and exits.
* There are methods to get the RemoteMudPerson object for a named person,
* to get a description of a named thing, and to go through a named exit.
* There are methods for interacting with other people in the MUD. There
* are methods for building the MUD by creating and destroying things,
* adding new places (and new exits to those places), for linking a place
* through a new exit to some other place (possibly on another MUD server),
* and for closing down an existing exit.
**/
public interface RemoteMudPlace extends Remote {
/** Look up the name of this place */
public String getPlaceName() throws RemoteException;
/** Get a description of this place */
public String getDescription() throws RemoteException;
/** Find out the names of all people here */
public Vector getNames() throws RemoteException;
/** Get the names of all things here */
public Vector getThings() throws RemoteException;
/** Get the names of all ways out of here */
public Vector getExits() throws RemoteException;
/** Get the RemoteMudPerson object for the named person. */
public RemoteMudPerson getPerson(String name)
throws RemoteException, NoSuchPerson;
/** Get more details about a named thing */
public String examineThing(String name)
throws RemoteException,NoSuchThing;
/** Use the named exit */
public RemoteMudPlace go(RemoteMudPerson who, String direction)
throws RemoteException,NotThere,AlreadyThere,NoSuchExit,LinkFailed;
/** Send a message of the form "David: hi everyone" */
public void speak(RemoteMudPerson speaker, String msg)
throws RemoteException, NotThere;
/** Send a message of the form "David laughs loudly" */
public void act(RemoteMudPerson speaker, String msg)
throws RemoteException, NotThere;
/** Add a new thing in this place */
public void createThing(RemoteMudPerson who, String name,
String description)
throws RemoteException, NotThere, AlreadyThere;
Search WWH ::




Custom Search