Add support for clone().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@783 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: OccupantInfo.java,v 1.4 2001/12/14 00:11:17 mdb Exp $
|
// $Id: OccupantInfo.java,v 1.5 2001/12/15 04:20:00 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.crowd.data;
|
package com.threerings.crowd.data;
|
||||||
|
|
||||||
@@ -13,15 +13,22 @@ import com.threerings.presents.dobj.DSet;
|
|||||||
* The occupant info object contains all of the information about an
|
* The occupant info object contains all of the information about an
|
||||||
* occupant of a place that should be shared with other occupants of the
|
* 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
|
* 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
|
* updated when bodies enter and exit a place.
|
||||||
* the Crowd framework can extend this class to include extra information
|
*
|
||||||
* about their occupants. They will need to be sure to return the proper
|
* <p> A system that builds upon the Crowd framework can extend this class
|
||||||
* class from {@link
|
* to include extra information about their occupants. They will need to
|
||||||
* com.threerings.crowd.server.PlaceManager#getOccupantInfoClass}
|
* be sure to return the proper class from {@link
|
||||||
* and populate their occupant info in {@link
|
* com.threerings.crowd.server.PlaceManager#getOccupantInfoClass} and
|
||||||
|
* populate their occupant info in {@link
|
||||||
* com.threerings.crowd.server.PlaceManager#populateOccupantInfo}.
|
* com.threerings.crowd.server.PlaceManager#populateOccupantInfo}.
|
||||||
|
*
|
||||||
|
* <p> Note also that this class implements {@link 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.
|
||||||
*/
|
*/
|
||||||
public class OccupantInfo implements DSet.Element
|
public class OccupantInfo
|
||||||
|
implements DSet.Element, Cloneable
|
||||||
{
|
{
|
||||||
/** The body object id of this occupant (and our element key). */
|
/** The body object id of this occupant (and our element key). */
|
||||||
public Integer bodyOid;
|
public Integer bodyOid;
|
||||||
@@ -41,6 +48,18 @@ public class OccupantInfo implements DSet.Element
|
|||||||
return bodyOid;
|
return bodyOid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a cloned copy of this instance.
|
||||||
|
*/
|
||||||
|
public Object clone ()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return super.clone();
|
||||||
|
} catch (CloneNotSupportedException cnse) {
|
||||||
|
throw new RuntimeException("WTF? " + cnse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
public void writeTo (DataOutputStream out)
|
public void writeTo (DataOutputStream out)
|
||||||
throws IOException
|
throws IOException
|
||||||
|
|||||||
Reference in New Issue
Block a user