summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jrummikub/control/TurnControl.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jrummikub/control/TurnControl.java b/src/jrummikub/control/TurnControl.java
index f73a6a4..417c7b4 100644
--- a/src/jrummikub/control/TurnControl.java
+++ b/src/jrummikub/control/TurnControl.java
@@ -13,13 +13,13 @@ public class TurnControl {
private ITurnTimer timer;
private IView view;
private Event endOfTurnEvent = new Event();
+ IListener endOfTurnListener;
public TurnControl(IHand hand, ITable table, IView view) {
this.hand = hand;
this.table = table;
this.view = view;
this.timer = new TurnTimer(view);
- setup();
}
/** Test only constructor **/
@@ -28,12 +28,11 @@ public class TurnControl {
this.table = table;
this.view = view;
this.timer = testTimer;
- setup();
}
- private void setup() {
+ public void startTurn() {
- IListener endOfTurnListener = new IListener() {
+ endOfTurnListener = new IListener() {
@Override
public void handle() {
@@ -60,6 +59,7 @@ public class TurnControl {
private void endOfTurn() {
timer.stopTimer();
endOfTurnEvent.emit();
+ view.getPlayerPanel().getEndTurnEvent().remove(endOfTurnListener);
}
public IEvent getEndOfTurnEvent() {