diff options
Diffstat (limited to 'test/jrummikub/control/RoundControlTest.java')
-rw-r--r-- | test/jrummikub/control/RoundControlTest.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java index d709b6b..f726a38 100644 --- a/test/jrummikub/control/RoundControlTest.java +++ b/test/jrummikub/control/RoundControlTest.java @@ -147,7 +147,7 @@ public class RoundControlTest { Stone blueTwo = new Stone(2, BLUE); Stone blueThree = new Stone(3, BLUE); - IHand hand = roundState.getActivePlayer().getHand(); + IHand hand = roundControl.clonedHand; hand.drop(blueOne, new Position(0, 0)); hand.drop(blueTwo, new Position(0, 0)); hand.drop(blueThree, new Position(0, 0)); @@ -177,7 +177,7 @@ public class RoundControlTest { } view.startTurnEvent.emit(); - IHand hand = roundState.getActivePlayer().getHand(); + IHand hand = roundControl.clonedHand; assertFalse(roundState.getActivePlayer().getLaidOut()); @@ -202,7 +202,7 @@ public class RoundControlTest { Stone blueTwo = new Stone(2, BLUE); Stone blueThree = new Stone(3, BLUE); - IHand hand = roundState.getActivePlayer().getHand(); + IHand hand = roundControl.clonedHand; hand.drop(blueOne, new Position(0, 0)); hand.drop(blueTwo, new Position(0, 0)); hand.drop(blueThree, new Position(0, 0)); @@ -255,7 +255,7 @@ public class RoundControlTest { Stone blueTwo = new Stone(2, BLUE); Stone blueThree = new Stone(3, BLUE); - IHand hand = roundState.getActivePlayer().getHand(); + IHand hand = roundControl.clonedHand; hand.drop(blueOne, new Position(0, 0)); hand.drop(blueTwo, new Position(0, 0)); hand.drop(blueThree, new Position(0, 0)); @@ -286,7 +286,7 @@ public class RoundControlTest { Stone redNine = new Stone(9, RED); Stone redTen = new Stone(10, RED); - hand = roundState.getActivePlayer().getHand(); + hand = roundControl.clonedHand; hand.drop(redEight, new Position(0, 0)); hand.drop(redNine, new Position(0, 0)); hand.drop(redTen, new Position(0, 0)); @@ -326,7 +326,7 @@ public class RoundControlTest { Stone blueTwo = new Stone(2, BLUE); Stone blueThree = new Stone(3, BLUE); - IHand hand = roundState.getActivePlayer().getHand(); + IHand hand = roundControl.clonedHand; hand.drop(blueOne, new Position(0, 0)); hand.drop(blueTwo, new Position(0, 0)); hand.drop(blueThree, new Position(0, 0)); @@ -358,7 +358,7 @@ public class RoundControlTest { Stone redTen = new Stone(10, RED); Stone redEleven = new Stone(11, RED); - hand = roundState.getActivePlayer().getHand(); + hand = roundControl.clonedHand; hand.drop(redEight, new Position(0, 0)); hand.drop(redNine, new Position(0, 0)); hand.drop(redTen, new Position(0, 0)); @@ -400,7 +400,7 @@ public class RoundControlTest { Stone blueSix = new Stone(6, BLUE); Stone blueSeven = new Stone(7, BLUE); - IHand hand = roundState.getActivePlayer().getHand(); + IHand hand = roundControl.clonedHand; hand.drop(blueFive, new Position(0, 0)); hand.drop(blueSix, new Position(0, 0)); hand.drop(blueSeven, new Position(0, 0)); @@ -427,7 +427,7 @@ public class RoundControlTest { assertEquals(2, roundState.getTable().getSize()); view.startTurnEvent.emit(); - hand = roundState.getActivePlayer().getHand(); + hand = roundControl.clonedHand; view.tablePanel.stoneClickEvent.emit(blueFour, false); view.tablePanel.stoneClickEvent.emit(blueFive, true); @@ -464,7 +464,7 @@ public class RoundControlTest { Stone blueTwo = new Stone(2, BLUE); Stone blueThree = new Stone(3, BLUE); - IHand hand = roundState.getActivePlayer().getHand(); + IHand hand = roundControl.clonedHand; hand.drop(blueOne, new Position(0, 0)); hand.drop(blueTwo, new Position(0, 0)); hand.drop(blueThree, new Position(0, 0)); @@ -573,7 +573,7 @@ public class RoundControlTest { view.startTurnEvent.emit(); assertSame(BottomPanelType.HUMAN_HAND_PANEL, view.bottomPanelType); - IHand hand = testRoundState.players.get(0).hand; + IHand hand = testRound.clonedHand; Stone stone = hand.iterator().next().getFirst(); hand.pickUp(stone); testTable.drop(new StoneSet(stone), new Position(0, 0)); @@ -658,7 +658,7 @@ public class RoundControlTest { view.startTurnEvent.emit(); assertSame(BottomPanelType.HUMAN_HAND_PANEL, view.bottomPanelType); - IHand hand = testRoundState.players.get(0).hand; + IHand hand = testRound.clonedHand; Stone blueEight = new Stone(8, BLUE); Stone blackEight = new Stone(8, BLACK); @@ -680,6 +680,7 @@ public class RoundControlTest { for (int i = 0; i < 4; i++) { testRoundState.players.get(i).hand = new Hand(); } + testRound.clonedHand = (IHand) testRoundState.players.get(3).hand.clone(); resetTurnStart(); assertFalse(roundEnded); @@ -952,6 +953,7 @@ public class RoundControlTest { hand.drop(new Stone(i / 2, RED), new Position(0, 0)); } testRoundState.players.get(0).hand = hand; + testRound.clonedHand = (IHand) hand.clone(); view.startTurnEvent.emit(); assertEquals(view.playerPanel.turnMode, TurnMode.MAY_REDEAL); for (int i = 0; i < 4; i++) { |