summaryrefslogtreecommitdiffstats
path: root/src/jrummikub
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-05-05 15:57:13 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-05-05 15:57:13 +0200
commitf5075789facf8a133f1c225ca9d25a1e0a801f43 (patch)
tree3cfece368a1413ee609f60942bcbf1a48dd69da2 /src/jrummikub
parent433a0c3561eeaec96c23656a347e38e3a3602597 (diff)
downloadJRummikub-f5075789facf8a133f1c225ca9d25a1e0a801f43.tar
JRummikub-f5075789facf8a133f1c225ca9d25a1e0a801f43.zip
Table Difference Test gebaut, anfang Implementierung round control
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@143 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub')
-rw-r--r--src/jrummikub/control/RoundControl.java31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java
index 2282666..cce6160 100644
--- a/src/jrummikub/control/RoundControl.java
+++ b/src/jrummikub/control/RoundControl.java
@@ -1,14 +1,19 @@
package jrummikub.control;
+import java.util.Set;
+
import jrummikub.model.IGameState;
import jrummikub.model.IHand;
+import jrummikub.model.ITable;
import jrummikub.model.Position;
+import jrummikub.model.Stone;
import jrummikub.util.IListener;
import jrummikub.view.IView;
public class RoundControl {
private IGameState gameState;
private IView view;
+ private ITable clonedTable;
public RoundControl(IGameState gameState, IView view) {
this.gameState = gameState;
@@ -25,24 +30,32 @@ public class RoundControl {
startTurn();
}
});
-
view.enableStartTurnPanel(true);
- view.getTablePanel().setStoneSets(gameState.getTable().clone());
+ clonedTable = (ITable) gameState.getTable().clone();
+ view.getTablePanel().setStoneSets(clonedTable);
}
private void startTurn() {
TurnControl turnControl = new TurnControl(gameState.getActivePlayer()
- .getHand(), gameState.getTable(), view);
-
-
+ .getHand(), clonedTable, view);
+ turnControl.getEndOfTurnEvent().add(new IListener() {
+
+ @Override
+ public void handle() {
+ endOfTurn();
+ }
+ });
+ // turnControl.startTurn();
}
void deal() {
for (int i = 0; i < gameState.getPlayerCount(); i++) {
IHand hand = gameState.getPlayer(i).getHand();
for (int j = 0; j < 7; j++) {
- hand.drop(gameState.getGameHeap().drawStone(), new Position(j, 0));
- hand.drop(gameState.getGameHeap().drawStone(), new Position(j, 1));
+ hand.drop(gameState.getGameHeap().drawStone(), new Position(j,
+ 0));
+ hand.drop(gameState.getGameHeap().drawStone(), new Position(j,
+ 1));
}
}
}
@@ -51,8 +64,8 @@ public class RoundControl {
}
- private void ruleCheck() {
-
+ static Set<Stone> tableDifference(ITable oldTable, ITable newTable) {
+ return null;
}
private void resetTable() {