Added getOccupantInfo by name.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1796 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-10-09 06:33:48 +00:00
parent a8e6c46f70
commit 0292de57cb
2 changed files with 42 additions and 2 deletions
@@ -1,8 +1,10 @@
//
// $Id: PlaceObject.java,v 1.8 2002/09/13 00:20:43 mdb Exp $
// $Id: PlaceObject.java,v 1.9 2002/10/09 06:33:48 mdb Exp $
package com.threerings.crowd.data;
import java.util.Iterator;
import com.threerings.presents.dobj.DObject;
import com.threerings.presents.dobj.DSet;
import com.threerings.presents.dobj.OidList;
@@ -42,6 +44,24 @@ public class PlaceObject extends DObject
/** Used to generate speak requests on this place object. */
public SpeakMarshaller speakService;
/**
* Looks up a user's occupant info by name.
*
* @return the occupant info record for the named user or null if no
* user in the room has that username.
*/
public OccupantInfo getOccupantInfo (String username)
{
Iterator iter = occupantInfo.entries();
while (iter.hasNext()) {
OccupantInfo info = (OccupantInfo)iter.next();
if (info.username.equals(username)) {
return info;
}
}
return null;
}
/**
* Requests that the specified oid be added to the
* <code>occupants</code> oid list. The list will not change until the