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:
@@ -1,8 +1,10 @@
|
|||||||
//
|
//
|
||||||
// $Id: PlaceObject.dobj,v 1.11 2002/09/13 00:20:43 mdb Exp $
|
// $Id: PlaceObject.dobj,v 1.12 2002/10/09 06:33:48 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.crowd.data;
|
package com.threerings.crowd.data;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.threerings.presents.dobj.DObject;
|
import com.threerings.presents.dobj.DObject;
|
||||||
import com.threerings.presents.dobj.DSet;
|
import com.threerings.presents.dobj.DSet;
|
||||||
import com.threerings.presents.dobj.OidList;
|
import com.threerings.presents.dobj.OidList;
|
||||||
@@ -32,4 +34,22 @@ public class PlaceObject extends DObject
|
|||||||
|
|
||||||
/** Used to generate speak requests on this place object. */
|
/** Used to generate speak requests on this place object. */
|
||||||
public SpeakMarshaller speakService;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
package com.threerings.crowd.data;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.threerings.presents.dobj.DObject;
|
import com.threerings.presents.dobj.DObject;
|
||||||
import com.threerings.presents.dobj.DSet;
|
import com.threerings.presents.dobj.DSet;
|
||||||
import com.threerings.presents.dobj.OidList;
|
import com.threerings.presents.dobj.OidList;
|
||||||
@@ -42,6 +44,24 @@ public class PlaceObject extends DObject
|
|||||||
/** Used to generate speak requests on this place object. */
|
/** Used to generate speak requests on this place object. */
|
||||||
public SpeakMarshaller speakService;
|
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
|
* Requests that the specified oid be added to the
|
||||||
* <code>occupants</code> oid list. The list will not change until the
|
* <code>occupants</code> oid list. The list will not change until the
|
||||||
|
|||||||
Reference in New Issue
Block a user