// // $Id: BodyObject.dobj,v 1.12 2003/06/14 00:55:40 mdb Exp $ package com.threerings.crowd.data; import com.threerings.presents.data.ClientObject; import com.threerings.crowd.chat.data.SpeakObject; /** * The basic user object class for Crowd users. Bodies have a username, a * location and a status. */ public class BodyObject extends ClientObject implements SpeakObject { /** * The username associated with this body object. */ public String username; /** * The oid of the place currently occupied by this body or -1 if they * currently occupy no place. */ public int location = -1; /** * The user's current status ({@link OccupantInfo#ACTIVE}, etc.). */ public byte status; /** * The time at which the {@link #status} field was last updated. This * is only available on the server. */ public transient long statusTime; // documentation inherited public void applyToListeners (ListenerOp op) { op.apply(getOid()); } // documentation inherited public String who () { StringBuffer buf = new StringBuffer(username); buf.append(" (").append(getOid()); if (status != OccupantInfo.ACTIVE) { buf.append(" ").append(OccupantInfo.X_STATUS[status]); } return buf.append(")").toString(); } }