Extract occupant info adding into an overridable method so that derived classes

can both participate in the combined event that adds an occupant's info and can
coordinate whether their info is added before or after.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5586 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-12-10 01:04:05 +00:00
parent a3e1c6e09e
commit 49f2bdb493
@@ -322,12 +322,7 @@ public class PlaceManager
_plobj.startTransaction();
try {
// clone the canonical copy and insert it into the DSet
_plobj.addToOccupantInfo((OccupantInfo)info.clone());
// add the body oid to our place object's occupant list
_plobj.addToOccupants(body.getOid());
addOccupantInfo((OccupantInfo)info.clone());
} finally {
_plobj.commitTransaction();
}
@@ -580,6 +575,21 @@ public class PlaceManager
}
}
/**
* Adds this occupant's info to the {@link PlaceObject}. This is called in a transaction on the
* place object so if a derived class needs to add additional information for an occupant it
* should override this method. It may opt to add the information before calling super if it
* wishes to rely on its information being configured when {@link #bodyAdded} is called.
*/
protected void addOccupantInfo (OccupantInfo info)
{
// clone the canonical copy and insert it into the DSet
_plobj.addToOccupantInfo(info);
// add the body oid to our place object's occupant list
_plobj.addToOccupants(info.getBodyOid());
}
/**
* Returns whether the location should be marked as empty and potentially shutdown.
*/