Create controllers in the new way (actionscript wants to be all growed up

just like uncle Java!).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4028 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-04-18 01:58:44 +00:00
parent a0ff0d1457
commit cd8f168452
2 changed files with 7 additions and 12 deletions
@@ -313,18 +313,13 @@ public class LocationDirector extends BasicDirector
_placeId = placeId; _placeId = placeId;
// check whether we should use a custom class loader // check whether we should use a custom class loader
var cclass :Class = config.getControllerClass(); _controller = config.createController();
try { if (_controller == null) {
// start up a new place controller to manage the new place Log.warning("Place config returned null controller " +
_controller = (new cclass() as PlaceController); "[config=" + config + "].");
_controller.init(_cctx, config); return;
} catch (e :Error) {
Log.warning("Error creating or initializing place controller " +
"[cclass=" + cclass +
", config=" + config + "].");
Log.logStackTrace(e);
} }
_controller.init(_cctx, config);
// subscribe to our new place object to complete the move // subscribe to our new place object to complete the move
_cctx.getDObjectManager().subscribeToObject(_placeId, this); _cctx.getDObjectManager().subscribeToObject(_placeId, this);
@@ -48,7 +48,7 @@ public /*abstract*/ class PlaceConfig
* this place. The controller class must derive from {@link * this place. The controller class must derive from {@link
* PlaceController}. * PlaceController}.
*/ */
public function getControllerClass () :Class public function createController () :PlaceController
{ {
return null; return null;
} }