From bc827302d0753a67774fd625d0c90eba7d83094f Mon Sep 17 00:00:00 2001 From: Bennet Gerlach Date: Thu, 5 May 2011 00:19:02 +0200 Subject: Show initial hand succeeds git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@136 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/control/TurnControl.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/jrummikub/control/TurnControl.java b/src/jrummikub/control/TurnControl.java index 26084e3..f73a6a4 100644 --- a/src/jrummikub/control/TurnControl.java +++ b/src/jrummikub/control/TurnControl.java @@ -1,6 +1,5 @@ package jrummikub.control; - import jrummikub.model.IHand; import jrummikub.model.ITable; import jrummikub.util.Event; @@ -14,7 +13,6 @@ public class TurnControl { private ITurnTimer timer; private IView view; private Event endOfTurnEvent = new Event(); - public TurnControl(IHand hand, ITable table, IView view) { this.hand = hand; @@ -23,21 +21,20 @@ public class TurnControl { this.timer = new TurnTimer(view); setup(); } - + /** Test only constructor **/ TurnControl(IHand hand, ITable table, IView view, ITurnTimer testTimer) { - // TODO: change timer to interface this.hand = hand; this.table = table; this.view = view; this.timer = testTimer; setup(); } - + private void setup() { - + IListener endOfTurnListener = new IListener() { - + @Override public void handle() { endOfTurn(); @@ -45,6 +42,11 @@ public class TurnControl { }; timer.getTimeRunOutEvent().add(endOfTurnListener); view.getPlayerPanel().getEndTurnEvent().add(endOfTurnListener); + + view.getPlayerPanel().getHandPanel().setStones(hand.clone()); + view.enableStartTurnPanel(false); + + timer.startTimer(); } private void sortByValue() { @@ -54,12 +56,12 @@ public class TurnControl { private void sortByColor() { } - + private void endOfTurn() { timer.stopTimer(); endOfTurnEvent.emit(); } - + public IEvent getEndOfTurnEvent() { return endOfTurnEvent; } -- cgit v1.2.3