From 70af06e1bff47a36de9d9106412388b2f5b91f15 Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Wed, 8 Jun 2011 17:46:44 +0200 Subject: LAden und Speichern geht jetzt immer sauber git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@388 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/control/RoundControl.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/jrummikub/control/RoundControl.java') diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java index 4fadc15..e1009af 100644 --- a/src/jrummikub/control/RoundControl.java +++ b/src/jrummikub/control/RoundControl.java @@ -84,6 +84,14 @@ public class RoundControl { prepareTurn(); } + public void abortRound() { + removeListeners(); + if (turnControl != null) { + turnControl.abortTurn(); + turnControl = null; + } + } + private void prepareTurn() { boolean isHuman = roundState.getActivePlayer().getPlayerSettings() .getTurnControlType() == HUMAN; @@ -294,14 +302,18 @@ public class RoundControl { } void endOfRound() { - for (Connection c : connections) { - c.remove(); - } + removeListeners(); Score roundScore = score(); endOfRoundEvent.emit(roundScore); roundFinished = true; } + private void removeListeners() { + for (Connection c : connections) { + c.remove(); + } + } + private Score score() { List winners = new ArrayList(); List points = new ArrayList(); -- cgit v1.2.3