summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/ApplicationControl.java
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-05-27 15:00:28 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-05-27 15:00:28 +0200
commit531fe57b17394c931ee968a66104429e69cf60c6 (patch)
tree30976cf9a7909df97bd49740c74a835edf9f47c3 /src/jrummikub/control/ApplicationControl.java
parentdf79c78dec6d9db0c60709fcb6728b5fab170379 (diff)
downloadJRummikub-531fe57b17394c931ee968a66104429e69cf60c6.tar
JRummikub-531fe57b17394c931ee968a66104429e69cf60c6.zip
Test für SettingsControl, 3 neue Klassen, Mocks für SettingPanel, lauter fixes
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@285 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control/ApplicationControl.java')
-rw-r--r--src/jrummikub/control/ApplicationControl.java42
1 files changed, 10 insertions, 32 deletions
diff --git a/src/jrummikub/control/ApplicationControl.java b/src/jrummikub/control/ApplicationControl.java
index b3d432c..8e09853 100644
--- a/src/jrummikub/control/ApplicationControl.java
+++ b/src/jrummikub/control/ApplicationControl.java
@@ -15,7 +15,7 @@ public class ApplicationControl {
* Creates a new application control
*
* @param view
- * the view to use
+ * the view to use
*/
public ApplicationControl(IView view) {
this.view = view;
@@ -25,39 +25,17 @@ public class ApplicationControl {
* Starts the application by showing the game settings dialog panel
*/
public void startApplication() {
- view.getSettingsPanel().getSettingsChangeEvent()
- .add(new IListener1<GameSettings>() {
- @Override
- public void handle(GameSettings settings) {
- checkSettings(settings);
- }
- });
- view.getSettingsPanel().getStartGameEvent()
- .add(new IListener1<GameSettings>() {
- @Override
- public void handle(GameSettings settings) {
- startGame(settings);
- }
- });
+ SettingsControl settingsControl = new SettingsControl(view);
+ settingsControl.getStartGameEvent().add(new IListener1<GameSettings>() {
- view.showSettingsPanel(true);
- }
-
- private boolean checkSettings(GameSettings settings) {
- // TODO Check
- // TODO Show error
+ @Override
+ public void handle(GameSettings settings) {
+ GameControl gameControl = new GameControl(settings, view);
+ gameControl.startGame();
- return true;
+ }
+ });
+ settingsControl.startSettings();
}
- private void startGame(GameSettings settings) {
- if (!checkSettings(settings)) {
- return;
- }
-
- view.showSettingsPanel(false);
-
- GameControl gameControl = new GameControl(settings, view);
- gameControl.startGame();
- }
}