Generated readObject()/writeObject(), widened some things along the way.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4689 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-05-04 22:17:41 +00:00
parent ea8bf25c0a
commit a60a71552a
11 changed files with 307 additions and 66 deletions
@@ -21,6 +21,10 @@
package com.threerings.crowd.data;
import java.io.IOException;
import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream;
import com.threerings.io.SimpleStreamableObject;
import com.threerings.util.Name;
@@ -29,20 +33,17 @@ import com.threerings.presents.dobj.DSet;
import com.threerings.crowd.data.BodyObject;
/**
* 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.
* 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.
*
* <p> 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 {@link BodyObject} that creates and configures their occupant info
* in {@link BodyObject#createOccupantInfo}.
* <p> 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 {@link BodyObject} that
* creates and configures their occupant info in {@link BodyObject#createOccupantInfo}.
*
* <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.
* <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 extends SimpleStreamableObject
implements DSet.Entry, Cloneable
@@ -69,8 +70,7 @@ public class OccupantInfo extends SimpleStreamableObject
public byte status = ACTIVE;
/**
* Creates an occupant info with information from the specified occupant's
* body object.
* Creates an occupant info with information from the specified occupant's body object.
*/
public OccupantInfo (BodyObject body)
{
@@ -107,4 +107,24 @@ public class OccupantInfo extends SimpleStreamableObject
throw new RuntimeException(cnse);
}
}
// AUTO-GENERATED: METHODS START
// from interface Streamable
public void readObject (ObjectInputStream ins)
throws IOException, ClassNotFoundException
{
bodyOid = ins.readInt();
username = (Name)ins.readObject();
status = ins.readByte();
}
// from interface Streamable
public void writeObject (ObjectOutputStream out)
throws IOException
{
out.writeInt(bodyOid);
out.writeObject(username);
out.writeByte(status);
}
// AUTO-GENERATED: METHODS END
}