Add client side to NetworkRoundControl test and implementation
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@498 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
ec54bde90a
commit
fcf33eb280
3 changed files with 86 additions and 9 deletions
|
@ -81,7 +81,10 @@ public class RoundControl {
|
|||
* Begin the round
|
||||
*/
|
||||
public void startRound() {
|
||||
deal();
|
||||
if (roundState != null) {
|
||||
deal();
|
||||
}
|
||||
|
||||
continueRound();
|
||||
}
|
||||
|
||||
|
@ -103,7 +106,9 @@ public class RoundControl {
|
|||
}
|
||||
}));
|
||||
|
||||
prepareTurn();
|
||||
if (roundState != null) {
|
||||
prepareTurn();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -117,11 +122,16 @@ public class RoundControl {
|
|||
}
|
||||
}
|
||||
|
||||
protected void setRoundState(IRoundState state) {
|
||||
roundState = state;
|
||||
roundStateUpdateEvent.emit(state);
|
||||
}
|
||||
|
||||
protected void prepareTurn() {
|
||||
doPrepareTurn();
|
||||
|
||||
boolean isHuman = roundState.getActivePlayer().getPlayerSettings()
|
||||
.getType() == HUMAN;
|
||||
.getType() == HUMAN;
|
||||
boolean oneHuman = roundState.getGameSettings().oneHuman();
|
||||
boolean isAI = (turnControl instanceof AIControl);
|
||||
|
||||
|
@ -157,6 +167,10 @@ public class RoundControl {
|
|||
}
|
||||
|
||||
protected void startTurn() {
|
||||
if (turnControl == null) {
|
||||
doPrepareTurn();
|
||||
}
|
||||
|
||||
boolean isHuman = roundState.getActivePlayer().getPlayerSettings()
|
||||
.getType() == HUMAN;
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ public class NetworkRoundControl extends RoundControl {
|
|||
new IListener1<IRoundState>() {
|
||||
@Override
|
||||
public void handle(IRoundState state) {
|
||||
NetworkRoundControl.this.roundState = state;
|
||||
setRoundState(state);
|
||||
|
||||
startTurn();
|
||||
}
|
||||
}));
|
||||
|
|
Reference in a new issue