package mug12; /** * The world for Multi-User Grinnell. Although it violates * some standards of object-oriented design, we use the world * as a central repository for all our objects. * * @author CSC152 2004F */ public interface WorldInterface { /** * Add Person to world */ public void addPerson(Person bob) throws NameTakenException; /** * Remove Person from world */ public void removePerson(Person bob); /** * Add Person to world */ public void addThing(Thing jim) throws NameTakenException; /** * Remove Person from world */ public void removeThing(Thing jim); /** * Determine what time it is in the world. * public Time time(); /** * Indicate that some time has passed. * void elapse(); */ /** * Sends a String to all persons in a room */ public void broadcast(String message, String[] sendTo); /** * Find all the people in a room */ public String[] listPeople(String room); /** * find all the things in a room */ public String[] listContents(String room); /** * Maps names to objects */ public Object map(String name) throws NotHere; public Verb mapVerb(String verb) throws InvalidVerb; /** * Record that an interaction has happened. Return a comment on the * results of the action. * * @exception * If the action is invalid or the object is invalid or ... */ public void perform(Action tim) throws InvalidVerb, InvalidTarget; } // interface World