Use GameDefinition.controller if it is configured.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@318 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
package com.threerings.ezgame.data {
|
package com.threerings.ezgame.data {
|
||||||
|
|
||||||
|
import com.threerings.util.ClassUtil;
|
||||||
import com.threerings.util.Hashable;
|
import com.threerings.util.Hashable;
|
||||||
import com.threerings.util.MessageBundle;
|
import com.threerings.util.MessageBundle;
|
||||||
import com.threerings.util.StreamableHashMap;
|
import com.threerings.util.StreamableHashMap;
|
||||||
@@ -113,6 +114,20 @@ public class EZGameConfig extends GameConfig
|
|||||||
|
|
||||||
// from PlaceConfig
|
// from PlaceConfig
|
||||||
override public function createController () :PlaceController
|
override public function createController () :PlaceController
|
||||||
|
{
|
||||||
|
var controller :String = getGameDefinition().controller;
|
||||||
|
if (controller == null) {
|
||||||
|
return createDefaultController();
|
||||||
|
}
|
||||||
|
var c :Class = ClassUtil.getClassByName(controller);
|
||||||
|
return (new c() as PlaceController);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the controller to be used if the game definition does not specify a custom
|
||||||
|
* controller.
|
||||||
|
*/
|
||||||
|
protected function createDefaultController () :PlaceController
|
||||||
{
|
{
|
||||||
return new EZGameController();
|
return new EZGameController();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user