Angefangener Test für Hand-Steine-verschwinden-fix
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@194 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
fffca3fe9a
commit
050ae5f224
4 changed files with 85 additions and 38 deletions
|
@ -14,6 +14,9 @@ import jrummikub.util.Pair;
|
|||
import jrummikub.view.IView;
|
||||
|
||||
public class RoundControl {
|
||||
// TODO move to game control once existent
|
||||
final static int HAND_HEIGHT = 2;
|
||||
final static int HAND_WIDTH = 14;
|
||||
private IGameState gameState;
|
||||
private IView view;
|
||||
private ITable clonedTable;
|
||||
|
@ -21,6 +24,8 @@ public class RoundControl {
|
|||
public RoundControl(IGameState gameState, IView view) {
|
||||
this.gameState = gameState;
|
||||
this.view = view;
|
||||
view.getPlayerPanel().getHandPanel().setHandHeight(HAND_HEIGHT);
|
||||
view.getPlayerPanel().getHandPanel().setHandWidth(HAND_WIDTH);
|
||||
}
|
||||
|
||||
public void startRound() {
|
||||
|
@ -68,14 +73,17 @@ 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<Stone> tableDiff = tableDifference(gameState.getTable(), clonedTable);
|
||||
Set<Stone> tableDiff = tableDifference(gameState.getTable(),
|
||||
clonedTable);
|
||||
|
||||
if (!tableDiff.isEmpty()) { // Player has made a move
|
||||
if (clonedTable.isValid()) {
|
||||
|
@ -118,7 +126,7 @@ public class RoundControl {
|
|||
return ret;
|
||||
}
|
||||
|
||||
private void dealStone() {
|
||||
void dealStone() {
|
||||
gameState
|
||||
.getActivePlayer()
|
||||
.getHand()
|
||||
|
|
Reference in a new issue