
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@285 72836036-5685-4462-b002-a69064685172
41 lines
911 B
Java
41 lines
911 B
Java
package jrummikub.control;
|
|
|
|
import jrummikub.model.GameSettings;
|
|
import jrummikub.util.IListener1;
|
|
import jrummikub.view.IView;
|
|
|
|
/**
|
|
* The application control controls the settings for a new games and create the
|
|
* game control
|
|
*/
|
|
public class ApplicationControl {
|
|
private IView view;
|
|
|
|
/**
|
|
* Creates a new application control
|
|
*
|
|
* @param view
|
|
* the view to use
|
|
*/
|
|
public ApplicationControl(IView view) {
|
|
this.view = view;
|
|
}
|
|
|
|
/**
|
|
* Starts the application by showing the game settings dialog panel
|
|
*/
|
|
public void startApplication() {
|
|
SettingsControl settingsControl = new SettingsControl(view);
|
|
settingsControl.getStartGameEvent().add(new IListener1<GameSettings>() {
|
|
|
|
@Override
|
|
public void handle(GameSettings settings) {
|
|
GameControl gameControl = new GameControl(settings, view);
|
|
gameControl.startGame();
|
|
|
|
}
|
|
});
|
|
settingsControl.startSettings();
|
|
}
|
|
|
|
}
|