summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-05-06 01:35:09 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-05-06 01:35:09 +0200
commit193e9247fac9d10e3c32cc7cacb65406ef9d19c8 (patch)
treebc3356b1fa99f1445f554ee2878753223fbd9d79 /src/jrummikub/control
parent55b19cef1d4594c0e4fe185b446eb59ad5f6bc85 (diff)
downloadJRummikub-193e9247fac9d10e3c32cc7cacb65406ef9d19c8.tar
JRummikub-193e9247fac9d10e3c32cc7cacb65406ef9d19c8.zip
Add winning notification and fix test...
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@161 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control')
-rw-r--r--src/jrummikub/control/RoundControl.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java
index 4949e2b..231b860 100644
--- a/src/jrummikub/control/RoundControl.java
+++ b/src/jrummikub/control/RoundControl.java
@@ -81,7 +81,12 @@ public class RoundControl {
if (clonedTable.isValid()) {
gameState.setTable(clonedTable);
- // TODO Win check
+ System.err.println(gameState.getActivePlayer().getName());
+ System.err.println(gameState.getActivePlayer().getHand().getSize());
+ if (gameState.getActivePlayer().getHand().getSize() == 0) {
+ win();
+ return;
+ }
} else {
gameState.getGameHeap().putBack(tableDiff);
dealPenalty(tableDiff.size());
@@ -127,4 +132,8 @@ public class RoundControl {
for (int i = 0; i < count + 3; ++i)
dealStone();
}
+
+ private void win() {
+ view.enableWinPanel(true);
+ }
}