diff options
Diffstat (limited to 'src/jrummikub/control')
-rw-r--r-- | src/jrummikub/control/ApplicationControl.java | 5 | ||||
-rw-r--r-- | src/jrummikub/control/GameControl.java | 3 | ||||
-rw-r--r-- | src/jrummikub/control/RoundControl.java | 14 | ||||
-rw-r--r-- | src/jrummikub/control/turn/HumanTurnControl.java | 3 |
4 files changed, 12 insertions, 13 deletions
diff --git a/src/jrummikub/control/ApplicationControl.java b/src/jrummikub/control/ApplicationControl.java index bcaf437..cf9a8ca 100644 --- a/src/jrummikub/control/ApplicationControl.java +++ b/src/jrummikub/control/ApplicationControl.java @@ -4,6 +4,7 @@ import jrummikub.model.GameSettings; import jrummikub.util.IListener; import jrummikub.util.IListener1; import jrummikub.view.IView; +import jrummikub.view.IView.BottomPanelType; /** * The application control controls the settings for a new games and create the @@ -27,8 +28,7 @@ public class ApplicationControl { */ public void startApplication() { view.showScorePanel(false); - view.enableWinPanel(false); - view.showInterface(false); + view.setBottomPanel(BottomPanelType.START_GAME_PANEL); SettingsControl settingsControl = new SettingsControl(view, new GameSettings()); settingsControl.getStartGameEvent().add(new IListener1<GameSettings>() { @@ -42,7 +42,6 @@ public class ApplicationControl { startApplication(); } }); - view.showInterface(true); gameControl.startGame(); } diff --git a/src/jrummikub/control/GameControl.java b/src/jrummikub/control/GameControl.java index 9eb9fa6..247e67a 100644 --- a/src/jrummikub/control/GameControl.java +++ b/src/jrummikub/control/GameControl.java @@ -14,6 +14,7 @@ import jrummikub.util.IEvent; import jrummikub.util.IListener; import jrummikub.util.IListener1; import jrummikub.view.IView; +import jrummikub.view.IView.BottomPanelType; /** * Controls a Game, at some point including all Rounds, starts new Rounds @@ -128,7 +129,7 @@ public class GameControl { gameState.getScores().add(roundScore); roundControl = null; - view.enableWinPanel(true); + view.setBottomPanel(BottomPanelType.WIN_PANEL); view.getScorePanel().setPlayers(gameSettings.getPlayerList()); view.getScorePanel().setScores(gameState.getScores()); diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java index 40894eb..86f8e05 100644 --- a/src/jrummikub/control/RoundControl.java +++ b/src/jrummikub/control/RoundControl.java @@ -1,5 +1,7 @@ package jrummikub.control; +import static jrummikub.control.turn.TurnControlFactory.Type.*; + import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -7,7 +9,6 @@ import java.util.Set; import jrummikub.control.turn.ITurnControl; import jrummikub.control.turn.TurnControlFactory; -import static jrummikub.control.turn.TurnControlFactory.Type.*; import jrummikub.model.Hand; import jrummikub.model.IHand; import jrummikub.model.IPlayer; @@ -25,6 +26,7 @@ import jrummikub.util.IEvent1; import jrummikub.util.IListener; import jrummikub.util.Pair; import jrummikub.view.IView; +import jrummikub.view.IView.BottomPanelType; /** * Controller that manages a single round of rummikub @@ -82,18 +84,15 @@ public class RoundControl { .getTurnControlType() == HUMAN; clonedTable = (ITable) roundState.getTable().clone(); - if (isHuman) { - view.enableStartTurnPanel(true); - } else { - view.enableThinkPanel(true); - } + view.setBottomPanel(isHuman ? BottomPanelType.START_TURN_PANEL + : BottomPanelType.COMPUTER_HAND_PANEL); view.getTablePanel().setStoneSets(clonedTable.clone()); view.setCurrentPlayerName(roundState.getActivePlayer().getPlayerSettings() .getName()); view.setCurrentPlayerColor(roundState.getActivePlayer().getPlayerSettings() .getColor()); - view.setHasLaidOut(roundState.getActivePlayer().getLaidOut()); + view.setCurrentPlayerHasLaidOut(roundState.getActivePlayer().getLaidOut()); if (!isHuman) startTurn(); @@ -156,7 +155,6 @@ public class RoundControl { } private void endOfTurn() { - view.enableThinkPanel(false); turnControl = null; if (roundState.getTurnNumber() >= 1) { checkTurn(); diff --git a/src/jrummikub/control/turn/HumanTurnControl.java b/src/jrummikub/control/turn/HumanTurnControl.java index c49d7ce..d7f7721 100644 --- a/src/jrummikub/control/turn/HumanTurnControl.java +++ b/src/jrummikub/control/turn/HumanTurnControl.java @@ -18,6 +18,7 @@ import jrummikub.util.IListener; import jrummikub.util.IListener1; import jrummikub.util.IListener2; import jrummikub.util.Pair; +import jrummikub.view.IView.BottomPanelType; /** * Controller for a single turn made by a human player @@ -87,7 +88,7 @@ public class HumanTurnControl extends AbstractTurnControl { view.getHandPanel().setStones(hand.clone()); view.getHandPanel().resetCurrentRow(); - view.enableStartTurnPanel(false); + view.setBottomPanel(BottomPanelType.HUMAN_HAND_PANEL); timer.startTimer(); } |