summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/control/network')
-rw-r--r--src/jrummikub/control/network/NetworkControl.java35
1 files changed, 3 insertions, 32 deletions
diff --git a/src/jrummikub/control/network/NetworkControl.java b/src/jrummikub/control/network/NetworkControl.java
index 6e42f83..2b5f90f 100644
--- a/src/jrummikub/control/network/NetworkControl.java
+++ b/src/jrummikub/control/network/NetworkControl.java
@@ -27,7 +27,6 @@ public class NetworkControl {
private IConnectionControl connectionControl;
private IView view;
private List<Connection> connections = new ArrayList<Connection>();
- Connection tempConnection;
private Event stopNetworkEvent = new Event();
private Event backToLoginEvent = new Event();
@@ -63,41 +62,10 @@ public class NetworkControl {
addConnectionSetupListeners(loginData, view);
addConnectionControlListeners(view);
-
- connections.add(view.getQuitEvent().add(new IListener() {
- @Override
- public void handle() {
- if (gameControl == null) {
- System.exit(0);
- } else {
- view.getQuitWarningPanel().setMode(QuitMode.QUIT_PROCESS);
- view.showQuitWarningPanel(true);
- tempConnection = view.getQuitWarningPanel().getQuitEvent()
- .add(new IListener() {
- @Override
- public void handle() {
- System.exit(0);
- }
- });
- }
- }
- }));
addViewEventListeners();
}
private void addViewEventListeners() {
- connections.add(view.getQuitWarningPanel().getCancelEvent()
- .add(new IListener() {
- @Override
- public void handle() {
- view.showQuitWarningPanel(false);
- if (tempConnection != null) {
- tempConnection.remove();
- tempConnection = null;
- }
- }
- }));
-
connections.add(view.getGameListPanel().getJoinEvent()
.add(new IListener1<GameData>() {
@Override
@@ -378,4 +346,7 @@ public class NetworkControl {
gameControl.startGame();
}
+ public boolean isGameRunning() {
+ return gameControl != null;
+ }
}