EZGameConfig can create its controller from the classname provided in the game
definition as a sensible default behavior. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@299 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -23,6 +23,8 @@ package com.threerings.ezgame.data;
|
|||||||
|
|
||||||
import com.threerings.util.StreamableHashMap;
|
import com.threerings.util.StreamableHashMap;
|
||||||
|
|
||||||
|
import com.threerings.crowd.client.PlaceController;
|
||||||
|
|
||||||
import com.threerings.parlor.game.client.GameConfigurator;
|
import com.threerings.parlor.game.client.GameConfigurator;
|
||||||
import com.threerings.parlor.game.data.GameConfig;
|
import com.threerings.parlor.game.data.GameConfig;
|
||||||
|
|
||||||
@@ -86,7 +88,17 @@ public class EZGameConfig extends GameConfig
|
|||||||
return new EZGameConfigurator();
|
return new EZGameConfigurator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from GameConfig
|
@Override // from PlaceConfig
|
||||||
|
public PlaceController createController ()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return (PlaceController) Class.forName(getGameDefinition().controller).newInstance();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override // from PlaceConfig
|
||||||
public String getManagerClassName ()
|
public String getManagerClassName ()
|
||||||
{
|
{
|
||||||
return _gameDef.manager;
|
return _gameDef.manager;
|
||||||
|
|||||||
Reference in New Issue
Block a user