diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-11 03:15:12 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-11 03:15:12 +0200 |
commit | dbd57d42188aa8499211f9a0461fd3511c80f578 (patch) | |
tree | d4945475a9990463379b2d70aa83c6269202cc04 /src/jrummikub/control/network/NetworkSettingsControl.java | |
parent | 630cdea1d9383aee75a984867682459d06c7c61a (diff) | |
download | JRummikub-dbd57d42188aa8499211f9a0461fd3511c80f578.tar JRummikub-dbd57d42188aa8499211f9a0461fd3511c80f578.zip |
Add NetworkSettingsControl
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@409 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control/network/NetworkSettingsControl.java')
-rw-r--r-- | src/jrummikub/control/network/NetworkSettingsControl.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/jrummikub/control/network/NetworkSettingsControl.java b/src/jrummikub/control/network/NetworkSettingsControl.java new file mode 100644 index 0000000..d1a56e6 --- /dev/null +++ b/src/jrummikub/control/network/NetworkSettingsControl.java @@ -0,0 +1,38 @@ +package jrummikub.control.network; + +import java.util.UUID; + +import jrummikub.control.SettingsControl; +import jrummikub.model.GameSettings; +import jrummikub.view.IGameListPanel.GameData; +import jrummikub.view.IView; + +public class NetworkSettingsControl extends SettingsControl { + private GameData gameData = new GameData(UUID.randomUUID()); + private ConnectionControl connectionControl; + + public NetworkSettingsControl(ConnectionControl connectionControl, IView view, GameSettings settings) { + super(view, settings); + this.connectionControl = connectionControl; + } + + @Override + public void startSettings() { + super.startSettings(); + } + + @Override + protected void update() { + super.update(); + + gameData.setMaxPlayerCount(settings.getPlayerList().size()); + + connectionControl.offerGame(gameData); + } + + @Override + public void abort() { + super.abort(); + connectionControl.withdrawGame(gameData.getGameID()); + } +} |