com.threerings.parlor.game.client
Class GameConfigurator

java.lang.Object
  extended by com.threerings.parlor.game.client.GameConfigurator
Direct Known Subclasses:
SwingGameConfigurator

public abstract class GameConfigurator
extends Object

Provides the base from which interfaces can be built to configure games prior to starting them. Derived classes would extend the base configurator adding interface elements and wiring them up properly to allow the user to configure an instance of their game.

Clients that use the game configurator will want to instantiate one based on the class returned from the GameConfig and then initialize it with a call to init(com.threerings.parlor.util.ParlorContext).


Field Summary
protected  GameConfig _config
          Our game configuration.
protected  ParlorContext _ctx
          Provides access to client services.
 
Constructor Summary
GameConfigurator()
           
 
Method Summary
protected  void createConfigInterface()
          The default implementation creates nothing.
protected  void flushGameConfig()
          Derived classes will want to override this method, flushing values from the user interface to the game config object so that it is properly configured prior to being returned to the getGameConfig() caller.
 GameConfig getGameConfig()
          Obtains a configured game configuration.
protected  void gotGameConfig()
          Derived classes will likely want to override this method and configure their user interface elements accordingly.
 void init(ParlorContext ctx)
          Initializes this game configurator, creates its user interface elements and prepares it for display.
 void setGameConfig(GameConfig config)
          Provides this configurator with its configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ctx

protected ParlorContext _ctx
Provides access to client services.


_config

protected GameConfig _config
Our game configuration.

Constructor Detail

GameConfigurator

public GameConfigurator()
Method Detail

init

public void init(ParlorContext ctx)
Initializes this game configurator, creates its user interface elements and prepares it for display.


createConfigInterface

protected void createConfigInterface()
The default implementation creates nothing.


setGameConfig

public void setGameConfig(GameConfig config)
Provides this configurator with its configuration. It should set up all of its user interface elements to reflect the configuration.


gotGameConfig

protected void gotGameConfig()
Derived classes will likely want to override this method and configure their user interface elements accordingly.


getGameConfig

public GameConfig getGameConfig()
Obtains a configured game configuration.


flushGameConfig

protected void flushGameConfig()
Derived classes will want to override this method, flushing values from the user interface to the game config object so that it is properly configured prior to being returned to the getGameConfig() caller.