Disable pause function in network mode
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@536 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
9b5f3648ed
commit
b62babba45
9 changed files with 117 additions and 89 deletions
|
@ -59,6 +59,10 @@ public abstract class AbstractTurnControl implements ITurnControl {
|
|||
}
|
||||
|
||||
protected void pauseTurn() {
|
||||
if (!turnInfo.isMayPause()) {
|
||||
return;
|
||||
}
|
||||
|
||||
timer.stopTimer();
|
||||
view.enablePauseMode(true);
|
||||
}
|
||||
|
@ -108,6 +112,8 @@ public abstract class AbstractTurnControl implements ITurnControl {
|
|||
resumeTurn();
|
||||
}
|
||||
}));
|
||||
|
||||
view.setMayPause(info.isMayPause());
|
||||
}
|
||||
|
||||
protected void cleanUp() {
|
||||
|
|
|
@ -73,6 +73,8 @@ public interface ITurnControl {
|
|||
|
||||
private TurnMode turnMode;
|
||||
|
||||
private boolean mayPause;
|
||||
|
||||
/**
|
||||
* Creates a new TurnInfo instance
|
||||
*
|
||||
|
@ -81,7 +83,7 @@ public interface ITurnControl {
|
|||
* @param turnMode
|
||||
* the turn mode
|
||||
*/
|
||||
public TurnInfo(IRoundState roundState, TurnMode turnMode) {
|
||||
public TurnInfo(IRoundState roundState, TurnMode turnMode, boolean mayPause) {
|
||||
this.roundState = roundState;
|
||||
|
||||
oldTable = roundState.getTable();
|
||||
|
@ -91,6 +93,8 @@ public interface ITurnControl {
|
|||
this.hand = (IHand) oldHand.clone();
|
||||
|
||||
this.turnMode = turnMode;
|
||||
|
||||
this.mayPause = mayPause;
|
||||
}
|
||||
|
||||
public IRoundState getRoundState() {
|
||||
|
@ -150,5 +154,9 @@ public interface ITurnControl {
|
|||
public TurnMode getTurnMode() {
|
||||
return turnMode;
|
||||
}
|
||||
|
||||
public boolean isMayPause() {
|
||||
return mayPause;
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue