summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/turn
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-06-21 03:52:25 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-06-21 03:52:25 +0200
commitb62babba458c703c4a7597bf4640a936227d734a (patch)
treea79c02c42ea33a9f3e5f46781fadb04c67e60d1a /src/jrummikub/control/turn
parent9b5f3648eda004f85c020fc7989c12557d08489a (diff)
downloadJRummikub-b62babba458c703c4a7597bf4640a936227d734a.tar
JRummikub-b62babba458c703c4a7597bf4640a936227d734a.zip
Disable pause function in network mode
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@536 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control/turn')
-rw-r--r--src/jrummikub/control/turn/AbstractTurnControl.java6
-rw-r--r--src/jrummikub/control/turn/ITurnControl.java10
2 files changed, 15 insertions, 1 deletions
diff --git a/src/jrummikub/control/turn/AbstractTurnControl.java b/src/jrummikub/control/turn/AbstractTurnControl.java
index d64ee62..9bdd6e2 100644
--- a/src/jrummikub/control/turn/AbstractTurnControl.java
+++ b/src/jrummikub/control/turn/AbstractTurnControl.java
@@ -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() {
diff --git a/src/jrummikub/control/turn/ITurnControl.java b/src/jrummikub/control/turn/ITurnControl.java
index 6994466..ab4d6ae 100644
--- a/src/jrummikub/control/turn/ITurnControl.java
+++ b/src/jrummikub/control/turn/ITurnControl.java
@@ -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;
+ }
}
} \ No newline at end of file