StartTurn panel für einen menschlichen spieler angepasst

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@447 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Ida Massow 2011-06-17 20:00:45 +02:00
parent 4f71c5cb47
commit a07e723242

View file

@ -101,11 +101,22 @@ public class RoundControl {
private void prepareTurn() {
boolean isHuman = roundState.getActivePlayer().getPlayerSettings()
.getType() == HUMAN;
boolean oneHuman = roundState.getGameSettings().oneHuman();
clonedTable = (ITable) roundState.getTable().clone();
clonedHand = (IHand) roundState.getActivePlayer().getHand().clone();
view.setBottomPanel(isHuman ? BottomPanelType.START_TURN_PANEL
: BottomPanelType.COMPUTER_HAND_PANEL);
if (!oneHuman) {
view.setBottomPanel(isHuman ? BottomPanelType.START_TURN_PANEL
: BottomPanelType.COMPUTER_HAND_PANEL);
} else {
if (!isHuman) {
view.setBottomPanel(BottomPanelType.COMPUTER_HAND_PANEL);
} else {
view.setBottomPanel(BottomPanelType.HUMAN_HAND_PANEL);
startTurn();
}
}
view.getTablePanel().setStoneSets(clonedTable.clone());
view.setCurrentPlayerName(roundState.getActivePlayer()
@ -138,8 +149,8 @@ public class RoundControl {
view.getPlayerPanel().setEndTurnMode(turnMode);
}
turnControl = TurnControlFactory.getFactory(
roundState.getActivePlayer().getPlayerSettings()
.getType()).create();
roundState.getActivePlayer().getPlayerSettings().getType())
.create();
turnControl.setup(new ITurnControl.TurnInfo(clonedTable, clonedHand,
roundState.getActivePlayer().getLaidOut(), turnMode),
roundState.getGameSettings(), view);
@ -348,8 +359,8 @@ public class RoundControl {
.getGameSettings());
}
bestScore = updateBestScore(bestScore, -stonePoints,
playerHand.getSize());
bestScore = updateBestScore(bestScore, -stonePoints, playerHand
.getSize());
points.add(-stonePoints);
pointSum += stonePoints;
@ -371,8 +382,8 @@ public class RoundControl {
private static Pair<Integer, Integer> updateBestScore(
Pair<Integer, Integer> bestScore, int stonePoints, int size) {
if (bestScore.getFirst() == stonePoints) {
return new Pair<Integer, Integer>(stonePoints, Math.min(
bestScore.getSecond(), size));
return new Pair<Integer, Integer>(stonePoints, Math.min(bestScore
.getSecond(), size));
} else if (bestScore.getFirst() < stonePoints) {
return new Pair<Integer, Integer>(stonePoints, size);
}