public class OccupantInfo extends SimpleStreamableObject implements DSet.Entry, Cloneable
A system that builds upon the Crowd framework can extend this class to include extra
information about their occupants. They will need to provide a derived BodyObject that
creates and configures their occupant info in BodyObject.createOccupantInfo(com.threerings.crowd.data.PlaceObject).
Note also that this class implements Cloneable which means that if derived classes
add non-primitive attributes, they are responsible for adding the code to clone those attributes
when a clone is requested.
| Modifier and Type | Class and Description |
|---|---|
static class |
OccupantInfo.NameUpdater
An update to dispatch when an occupant's name changes.
|
static interface |
OccupantInfo.Updater<T extends OccupantInfo>
Used by PlaceManager.updateOccupantInfo.
|
Streamable.Closure| Modifier and Type | Field and Description |
|---|---|
static byte |
ACTIVE
Constant value for
status. |
Integer |
bodyOid
The body object id of this occupant (and our entry key).
|
static byte |
DISCONNECTED
Constant value for
status. |
static byte |
IDLE
Constant value for
status. |
byte |
status
The status of this occupant.
|
Name |
username
The username of this occupant.
|
static String[] |
X_STATUS
Maps status codes to human readable strings.
|
| Constructor and Description |
|---|
OccupantInfo()
Used for unserialization.
|
OccupantInfo(BodyObject body)
Creates an occupant info with information from the specified occupant's body object.
|
| Modifier and Type | Method and Description |
|---|---|
OccupantInfo |
clone() |
int |
getBodyOid()
Access to the body object id as an int.
|
Comparable<?> |
getKey()
Each entry provide an associated key which is used to determine its uniqueness in the
set.
|
toStringpublic static final byte ACTIVE
status.public static final byte IDLE
status.public static final byte DISCONNECTED
status.public static final String[] X_STATUS
public Integer bodyOid
public Name username
public byte status
public OccupantInfo(BodyObject body)
public OccupantInfo()
public int getBodyOid()
public Comparable<?> getKey()
DSet.EntryDSet class documentation for further information.getKey in interface DSet.Entrypublic OccupantInfo clone()
Copyright © 2015. All rights reserved.