summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-05-30 21:04:43 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-05-30 21:04:43 +0200
commitd66d73ea8f9d660d14e3ef80e716ac1628704fe4 (patch)
treef87340553d08ae694df89ec97a3a0f90922ffcf1
parentd25a73167cd13a7da0cce97414455c210437ae2e (diff)
downloadJRummikub-d66d73ea8f9d660d14e3ef80e716ac1628704fe4.tar
JRummikub-d66d73ea8f9d660d14e3ef80e716ac1628704fe4.zip
Fixed out of stones rules
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@331 72836036-5685-4462-b002-a69064685172
-rw-r--r--src/jrummikub/control/RoundControl.java3
-rw-r--r--test/jrummikub/control/RoundControlTest.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java
index e1d2e97..5874532 100644
--- a/src/jrummikub/control/RoundControl.java
+++ b/src/jrummikub/control/RoundControl.java
@@ -165,7 +165,8 @@ public class RoundControl {
if (roundState.getLastPlayer() == null) {
if (roundState.getGameHeap().getSize() == 0) {
- roundState.setLastPlayer(roundState.getNthNextPlayer(-1));
+ roundState.setLastPlayer(roundState.getNthNextPlayer(0));
+ roundState.nextPlayer();
roundState.nextTurn();
} else {
roundState.nextPlayer();
diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java
index 8c8c67d..fd2d3fb 100644
--- a/test/jrummikub/control/RoundControlTest.java
+++ b/test/jrummikub/control/RoundControlTest.java
@@ -771,7 +771,7 @@ public class RoundControlTest {
view.startTurnEvent.emit();
view.playerPanel.endTurnEvent.emit(); // player 1 draws a card here
- assertSame(player1, roundState.getActivePlayer());
+ assertSame(player1, roundState.getNthNextPlayer(-1));
for (int i = 0; i < 4; i++) {
view.startTurnEvent.emit();