From 32d07341a5399f83968c698bb0fac3d8349caf57 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 10 May 2011 05:53:30 +0200 Subject: Define hand size constants in model git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@225 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/control/RoundControl.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/jrummikub/control/RoundControl.java') diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java index bb07964..7cea255 100644 --- a/src/jrummikub/control/RoundControl.java +++ b/src/jrummikub/control/RoundControl.java @@ -5,6 +5,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import jrummikub.model.Hand; import jrummikub.model.IGameState; import jrummikub.model.IHand; import jrummikub.model.ITable; @@ -32,9 +33,9 @@ public class RoundControl { * Create a new RoundControl using the given gameState and view * * @param gameState - * initial game state + * initial game state * @param view - * view used for user interaction + * view used for user interaction */ public RoundControl(IGameState gameState, IView view) { this.gameState = gameState; @@ -98,17 +99,14 @@ public class RoundControl { for (int i = 0; i < gameState.getPlayerCount(); i++) { IHand hand = gameState.getNthNextPlayer(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)); } } } private void endOfTurn() { - Set tableDiff = tableDifference(gameState.getTable(), - clonedTable); + Set tableDiff = tableDifference(gameState.getTable(), clonedTable); if (!tableDiff.isEmpty()) { // Player has made a move if (clonedTable.isValid()) { @@ -156,8 +154,7 @@ public class RoundControl { .getActivePlayer() .getHand() .drop(gameState.getGameHeap().drawStone(), - new Position(GameControl.HAND_WIDTH - 1, - GameControl.HAND_HEIGHT - 1)); + new Position(Hand.WIDTH - 1, Hand.HEIGHT - 1)); } private void dealPenalty(int count) { -- cgit v1.2.3