summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/RoundControl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/control/RoundControl.java')
-rw-r--r--src/jrummikub/control/RoundControl.java18
1 files changed, 15 insertions, 3 deletions
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<Boolean> winners = new ArrayList<Boolean>();
List<Integer> points = new ArrayList<Integer>();