We no longer need to set up our occupantInfo set with the type of object
it holds and we can now create custom occupant info classes depending on the body that is entering the place. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1270 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: PlaceManager.java,v 1.28 2002/03/18 23:21:26 mdb Exp $
|
// $Id: PlaceManager.java,v 1.29 2002/04/17 22:02:08 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.crowd.server;
|
package com.threerings.crowd.server;
|
||||||
|
|
||||||
@@ -135,9 +135,6 @@ public class PlaceManager
|
|||||||
// keep track of this
|
// keep track of this
|
||||||
_plobj = plobj;
|
_plobj = plobj;
|
||||||
|
|
||||||
// configure the occupant info set
|
|
||||||
plobj.occupantInfo.setEntryType(getOccupantInfoClass());
|
|
||||||
|
|
||||||
// we'll need to hear about place object events
|
// we'll need to hear about place object events
|
||||||
plobj.addListener(this);
|
plobj.addListener(this);
|
||||||
|
|
||||||
@@ -188,13 +185,14 @@ public class PlaceManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When the manager starts up, it configures its place object occupant
|
* Returns the appropriate derived class of {@link OccupantInfo} that
|
||||||
* info set by setting the type of occupant info objects it will
|
* will be used to provide occupant info for this body. An occupant
|
||||||
* contain. Managers that wish to use derived occupant info classes
|
* info record is created when a body enters a place.
|
||||||
* should override this function and return a reference to their
|
*
|
||||||
* derived class.
|
* @param body the body that is entering the place and for whom we are
|
||||||
|
* creating an occupant info record.
|
||||||
*/
|
*/
|
||||||
protected Class getOccupantInfoClass ()
|
protected Class getOccupantInfoClass (BodyObject body)
|
||||||
{
|
{
|
||||||
return OccupantInfo.class;
|
return OccupantInfo.class;
|
||||||
}
|
}
|
||||||
@@ -211,7 +209,7 @@ public class PlaceManager
|
|||||||
// create a new occupant info instance
|
// create a new occupant info instance
|
||||||
try {
|
try {
|
||||||
OccupantInfo info = (OccupantInfo)
|
OccupantInfo info = (OccupantInfo)
|
||||||
getOccupantInfoClass().newInstance();
|
getOccupantInfoClass(body).newInstance();
|
||||||
populateOccupantInfo(info, body);
|
populateOccupantInfo(info, body);
|
||||||
return info;
|
return info;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user