summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/ApplicationControl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/control/ApplicationControl.java')
-rw-r--r--src/jrummikub/control/ApplicationControl.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/jrummikub/control/ApplicationControl.java b/src/jrummikub/control/ApplicationControl.java
index 0f73310..a0bdf35 100644
--- a/src/jrummikub/control/ApplicationControl.java
+++ b/src/jrummikub/control/ApplicationControl.java
@@ -11,6 +11,7 @@ import jrummikub.view.IView.BottomPanelType;
* game control
*/
public class ApplicationControl {
+ private SaveControl saveControl;
private IView view;
/**
@@ -21,6 +22,7 @@ public class ApplicationControl {
*/
public ApplicationControl(IView view) {
this.view = view;
+ saveControl = new SaveControl(view);
view.getMenuQuitEvent().add(new IListener() {
@Override
@@ -38,11 +40,13 @@ public class ApplicationControl {
view.setBottomPanel(BottomPanelType.START_GAME_PANEL);
SettingsControl settingsControl = new SettingsControl(view,
new GameSettings());
- settingsControl.getStartGameEvent().add(new IListener1<GameSettings>() {
+ settingsControl.getStartGameEvent().add(new IListener1<GameSettings>() {
@Override
public void handle(GameSettings settings) {
- GameControl gameControl = new GameControl(settings, view);
+ saveControl.setGameSettings(settings);
+
+ GameControl gameControl = new GameControl(settings, saveControl, view);
gameControl.getEndOfGameEvent().add(new IListener() {
@Override
public void handle() {
@@ -55,5 +59,4 @@ public class ApplicationControl {
});
settingsControl.startSettings();
}
-
}