diff --git a/src/java/com/threerings/crowd/data/BodyObject.dobj b/src/java/com/threerings/crowd/data/BodyObject.dobj index 51ed386cd..ee0f948c2 100644 --- a/src/java/com/threerings/crowd/data/BodyObject.dobj +++ b/src/java/com/threerings/crowd/data/BodyObject.dobj @@ -1,5 +1,5 @@ // -// $Id: BodyObject.dobj,v 1.7 2002/02/04 01:47:20 mdb Exp $ +// $Id: BodyObject.dobj,v 1.8 2002/02/08 23:10:36 mdb Exp $ package com.threerings.crowd.data; @@ -7,12 +7,6 @@ import com.threerings.presents.data.ClientObject; public class BodyObject extends ClientObject { - /** The field name of the username field. */ - public static final String USERNAME = "username"; - - /** The field name of the location field. */ - public static final String LOCATION = "location"; - /** * The username associated with this body object. */ @@ -23,26 +17,4 @@ public class BodyObject extends ClientObject * currently occupy no place. */ public int location = -1; - - public void setUsername (String username) - { - requestAttributeChange(USERNAME, username); - } - - public void setUsernameImmediate (String username) - { - this.username = username; - requestAttributeChange(USERNAME, username); - } - - public void setLocation (int location) - { - requestAttributeChange(LOCATION, new Integer(location)); - } - - public void setLocationImmediate (int location) - { - this.location = location; - requestAttributeChange(LOCATION, new Integer(location)); - } } diff --git a/src/java/com/threerings/crowd/data/BodyObject.java b/src/java/com/threerings/crowd/data/BodyObject.java new file mode 100644 index 000000000..ab985a094 --- /dev/null +++ b/src/java/com/threerings/crowd/data/BodyObject.java @@ -0,0 +1,68 @@ +// +// $Id: BodyObject.java,v 1.1 2002/02/08 23:10:36 mdb Exp $ + +package com.threerings.crowd.data; + +import com.threerings.presents.data.ClientObject; + +public class BodyObject extends ClientObject +{ + /** The field name of the username field. */ + public static final String USERNAME = "username"; + + /** The field name of the location field. */ + public static final String LOCATION = "location"; + + /** + * 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; + + /** + * Requests that the username field be set to the specified + * value. + */ + public void setUsername (String username) + { + requestAttributeChange(USERNAME, username); + } + + /** + * Requests that the username field be set to the + * specified value and immediately updates the state of the object + * to reflect the change. This should only be called on the + * server and only then if you know what you're doing. + */ + public void setUsernameImmediate (String username) + { + this.username = username; + requestAttributeChange(USERNAME, username); + } + + /** + * Requests that the location field be set to the specified + * value. + */ + public void setLocation (int location) + { + requestAttributeChange(LOCATION, new Integer(location)); + } + + /** + * Requests that the location field be set to the + * specified value and immediately updates the state of the object + * to reflect the change. This should only be called on the + * server and only then if you know what you're doing. + */ + public void setLocationImmediate (int location) + { + this.location = location; + requestAttributeChange(LOCATION, new Integer(location)); + } +} diff --git a/src/java/com/threerings/crowd/data/PlaceObject.dobj b/src/java/com/threerings/crowd/data/PlaceObject.dobj index 6dd077bdf..04b73ada9 100644 --- a/src/java/com/threerings/crowd/data/PlaceObject.dobj +++ b/src/java/com/threerings/crowd/data/PlaceObject.dobj @@ -1,5 +1,5 @@ // -// $Id: PlaceObject.dobj,v 1.7 2002/02/04 01:47:20 mdb Exp $ +// $Id: PlaceObject.dobj,v 1.8 2002/02/08 23:10:36 mdb Exp $ package com.threerings.crowd.data; @@ -7,12 +7,6 @@ import com.threerings.presents.dobj.*; public class PlaceObject extends DObject { - /** The field name of the occupants field. */ - public static final String OCCUPANTS = "occupants"; - - /** The field name of the occupantInfo field. */ - public static final String OCCUPANT_INFO = "occupantInfo"; - /** * Tracks the oid of the body objects of all of the occupants of this * place. @@ -25,49 +19,4 @@ public class PlaceObject extends DObject * to be known by everyone in the place. */ public DSet occupantInfo = new DSet(); - - /** - * Requests that the specified oid be added to the - * occupants oid list. - */ - public void addToOccupants (int oid) - { - requestOidAdd(OCCUPANTS, oid); - } - - /** - * Requests that the specified oid be removed from the - * occupants oid list. - */ - public void removeFromOccupants (int oid) - { - requestOidRemove(OCCUPANTS, oid); - } - - /** - * Requests that the specified element be added to the - * occupantInfo set. - */ - public void addToOccupantInfo (DSet.Element elem) - { - requestElementAdd(OCCUPANT_INFO, elem); - } - - /** - * Requests that the element matching the supplied key be removed from - * the occupantInfo set. - */ - public void removeFromOccupantInfo (Object key) - { - requestElementRemove(OCCUPANT_INFO, key); - } - - /** - * Requests that the specified element be updated in the - * occupantInfo set. - */ - public void updateOccupantInfo (DSet.Element elem) - { - requestElementUpdate(OCCUPANT_INFO, elem); - } } diff --git a/src/java/com/threerings/crowd/data/PlaceObject.java b/src/java/com/threerings/crowd/data/PlaceObject.java new file mode 100644 index 000000000..640f2a2e1 --- /dev/null +++ b/src/java/com/threerings/crowd/data/PlaceObject.java @@ -0,0 +1,73 @@ +// +// $Id: PlaceObject.java,v 1.1 2002/02/08 23:10:36 mdb Exp $ + +package com.threerings.crowd.data; + +import com.threerings.presents.dobj.*; + +public class PlaceObject extends DObject +{ + /** The field name of the occupants field. */ + public static final String OCCUPANTS = "occupants"; + + /** The field name of the occupantInfo field. */ + public static final String OCCUPANT_INFO = "occupantInfo"; + + /** + * Tracks the oid of the body objects of all of the occupants of this + * place. + */ + public OidList occupants = new OidList(); + + /** + * Contains an info record (of type {@link OccupantInfo} for each + * occupant that contains information about that occupant that needs + * to be known by everyone in the place. + */ + public DSet occupantInfo = new DSet(); + + /** + * Requests that the specified oid be added to the + * occupants oid list. + */ + public void addToOccupants (int oid) + { + requestOidAdd(OCCUPANTS, oid); + } + + /** + * Requests that the specified oid be removed from the + * occupants oid list. + */ + public void removeFromOccupants (int oid) + { + requestOidRemove(OCCUPANTS, oid); + } + + /** + * Requests that the specified element be added to the + * occupantInfo set. + */ + public void addToOccupantInfo (DSet.Element elem) + { + requestElementAdd(OCCUPANT_INFO, elem); + } + + /** + * Requests that the element matching the supplied key be removed from + * the occupantInfo set. + */ + public void removeFromOccupantInfo (Object key) + { + requestElementRemove(OCCUPANT_INFO, key); + } + + /** + * Requests that the specified element be updated in the + * occupantInfo set. + */ + public void updateOccupantInfo (DSet.Element elem) + { + requestElementUpdate(OCCUPANT_INFO, elem); + } +}