summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jrummikub/control/RoundControl.java7
-rw-r--r--test/jrummikub/control/RoundControlTest.java16
2 files changed, 11 insertions, 12 deletions
diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java
index e04327f..124b196 100644
--- a/src/jrummikub/control/RoundControl.java
+++ b/src/jrummikub/control/RoundControl.java
@@ -136,11 +136,10 @@ public class RoundControl {
void deal() {
for (int i = 0; i < roundState.getPlayerCount(); i++) {
IHand hand = roundState.getNthNextPlayer(i).getHand();
- for (int j = 0; j < 7; j++) {
- hand.drop(roundState.getGameHeap().drawStone(), new Position(j,
+ for (int j = 0; j < roundState.getGameSettings()
+ .getNumberOfStonesDealt(); j++) {
+ hand.drop(roundState.getGameHeap().drawStone(), new Position(0,
0));
- hand.drop(roundState.getGameHeap().drawStone(), new Position(j,
- 1));
}
}
}
diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java
index 1ec91ca..a71e231 100644
--- a/test/jrummikub/control/RoundControlTest.java
+++ b/test/jrummikub/control/RoundControlTest.java
@@ -79,17 +79,17 @@ public class RoundControlTest {
}
private void checkCorrectlyDealt() {
- int totalStones = gameSettings.getHighestCard()
- * gameSettings.getStoneSetNumber()
- * gameSettings.getStoneColors().size()
- + gameSettings.getJokerNumber();
+ GameSettings settings = testRoundState.getGameSettings();
+ int totalStones = settings.getHighestCard()
+ * settings.getStoneSetNumber()
+ * settings.getStoneColors().size() + settings.getJokerNumber();
assertEquals(
totalStones - testRoundState.getPlayerCount()
- * gameSettings.getNumberOfStonesDealt()
+ * settings.getNumberOfStonesDealt()
- testRoundState.table.getSize(), testRoundState
.getGameHeap().getSize());
for (int i = 0; i < testRoundState.getPlayerCount(); i++) {
- assertEquals(gameSettings.getNumberOfStonesDealt(), testRoundState
+ assertEquals(settings.getNumberOfStonesDealt(), testRoundState
.getNthNextPlayer(i).getHand().getSize());
}
}
@@ -124,8 +124,8 @@ public class RoundControlTest {
@Test
public void checkCorrectlyDealtMoreStones() {
- gameSettings.setNumberOfStonesDealt(15);
- roundControl.startRound();
+ testRoundState.getGameSettings().setNumberOfStonesDealt(15);
+ testRound.deal();
checkCorrectlyDealt();
}