From 55b19cef1d4594c0e4fe185b446eb59ad5f6bc85 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 5 May 2011 23:29:07 +0200 Subject: Add stone dealing to RoundControl and fix some tests... again. git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@160 72836036-5685-4462-b002-a69064685172 --- mock/jrummikub/view/MockTablePanel.java | 3 +-- src/jrummikub/control/RoundControl.java | 6 +++++- test/jrummikub/control/RoundControlTest.java | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mock/jrummikub/view/MockTablePanel.java b/mock/jrummikub/view/MockTablePanel.java index 969ece6..c1d839c 100644 --- a/mock/jrummikub/view/MockTablePanel.java +++ b/mock/jrummikub/view/MockTablePanel.java @@ -68,8 +68,7 @@ public class MockTablePanel implements ITablePanel { @Override public IStoneCollectionPanel getStoneCollectionPanel() { - // TODO Auto-generated method stub - return null; + return stoneCollectionPanel; } @Override diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java index 00ebb6e..4949e2b 100644 --- a/src/jrummikub/control/RoundControl.java +++ b/src/jrummikub/control/RoundControl.java @@ -116,7 +116,11 @@ public class RoundControl { } private void dealStone() { - // gameState.getActivePlayer().getHand().drop(object, position) + gameState + .getActivePlayer() + .getHand() + .drop(gameState.getGameHeap().drawStone(), + new Position(7 + (int) (Math.random() * 6), 0.5f)); } private void dealPenalty(int count) { diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java index f716e27..116786e 100644 --- a/test/jrummikub/control/RoundControlTest.java +++ b/test/jrummikub/control/RoundControlTest.java @@ -67,7 +67,7 @@ public class RoundControlTest { private void checkTableDisplay() { Iterator> stoneSetsView = view.tablePanel.stoneSets .iterator(); - Iterator> stoneSetsModel = testGameState.table.sets + Iterator> stoneSetsModel = testGameState.table.clone().sets .iterator(); while (stoneSetsView.hasNext()) { -- cgit v1.2.3