diff --git a/src/java/com/threerings/micasa/lobby/table/TableListView.java b/src/java/com/threerings/micasa/lobby/table/TableListView.java index 82756f8a6..a56334fca 100644 --- a/src/java/com/threerings/micasa/lobby/table/TableListView.java +++ b/src/java/com/threerings/micasa/lobby/table/TableListView.java @@ -1,5 +1,5 @@ // -// $Id: TableListView.java,v 1.8 2004/08/27 02:12:51 mdb Exp $ +// $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved @@ -93,18 +93,14 @@ public class TableListView extends JPanel _matchList.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.add(new JScrollPane(_matchList)); - // create our configurator interface + // create and initialize the configurator interface GameConfig gconfig = null; try { gconfig = config.getGameConfig(); - Class cclass = gconfig.getConfiguratorClass(); - if (cclass != null) { - // create and initialize the configurator interface - _figger = (GameConfigurator)cclass.newInstance(); + _figger = gconfig.createConfigurator(); + if (_figger != null) { _figger.init(_ctx); - // give it the game config _figger.setGameConfig(gconfig); - // and add the whole business to the main UI panel.add(_figger, VGroupLayout.FIXED); } diff --git a/src/java/com/threerings/parlor/game/GameConfig.java b/src/java/com/threerings/parlor/game/GameConfig.java index 732f6a40e..abab590dc 100644 --- a/src/java/com/threerings/parlor/game/GameConfig.java +++ b/src/java/com/threerings/parlor/game/GameConfig.java @@ -24,6 +24,8 @@ package com.threerings.parlor.game; import com.threerings.crowd.data.PlaceConfig; import com.threerings.util.Name; +import com.threerings.parlor.client.GameConfigurator; + /** * The game config class encapsulates the configuration information for a * particular type of game. The hierarchy of game config objects mimics @@ -68,12 +70,11 @@ public abstract class GameConfig extends PlaceConfig implements Cloneable public abstract String getBundleName (); /** - * Returns the class that should be used to create a user interface - * that can be used to configure this instance prior to starting the - * game. The configurator class must derive from {@link - * GameConfigurator}. + * Creates a configurator that can be used to create a user interface + * for configuring this instance prior to starting the game. If no + * configuration is necessary, this method should return null. */ - public abstract Class getConfiguratorClass (); + public abstract GameConfigurator createConfigurator (); /** * Returns an array of strings that describe the configuration of this diff --git a/tests/src/java/com/threerings/parlor/TestConfig.java b/tests/src/java/com/threerings/parlor/TestConfig.java index 4510102a9..84364168b 100644 --- a/tests/src/java/com/threerings/parlor/TestConfig.java +++ b/tests/src/java/com/threerings/parlor/TestConfig.java @@ -1,5 +1,5 @@ // -// $Id: TestConfig.java,v 1.6 2004/08/27 02:21:02 mdb Exp $ +// $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved @@ -21,6 +21,7 @@ package com.threerings.parlor; +import com.threerings.parlor.client.GameConfigurator; import com.threerings.parlor.game.GameConfig; public class TestConfig extends GameConfig @@ -28,7 +29,7 @@ public class TestConfig extends GameConfig /** The foozle parameter. */ public int foozle; - public Class getConfiguratorClass () + public GameConfigurator createConfigurator () { return null; }