|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.io.SimpleStreamableObject
com.threerings.crowd.data.OccupantInfo
public class OccupantInfo
The occupant info object contains all of the information about an occupant of a place that should be shared with other occupants of the place. These objects are stored in the place object itself and are updated when bodies enter and exit a place.
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.
| Nested Class Summary | |
|---|---|
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. |
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
Streamable.Closure |
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
OccupantInfo()
Used for unserialization. |
|
OccupantInfo(BodyObject body)
Creates an occupant info with information from the specified occupant's body object. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class com.threerings.io.SimpleStreamableObject |
|---|
toString, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public 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
| Constructor Detail |
|---|
public OccupantInfo(BodyObject body)
public OccupantInfo()
| Method Detail |
|---|
public int getBodyOid()
public Comparable<?> getKey()
DSet.EntryDSet class documentation for further information.
getKey in interface DSet.Entrypublic OccupantInfo clone()
clone in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||