From e176dc46082c2e73daf82cafb5e6e10653db64eb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 11 Jun 2011 00:41:06 +0200 Subject: Display game list in GameListPanel git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@407 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/control/network/NetworkControl.java | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/jrummikub/control/network') diff --git a/src/jrummikub/control/network/NetworkControl.java b/src/jrummikub/control/network/NetworkControl.java index d56ea0e..ce7714b 100644 --- a/src/jrummikub/control/network/NetworkControl.java +++ b/src/jrummikub/control/network/NetworkControl.java @@ -2,6 +2,7 @@ package jrummikub.control.network; import java.util.ArrayList; import java.util.List; +import java.util.UUID; import jrummikub.util.Connection; import jrummikub.util.Event; @@ -19,17 +20,22 @@ public class NetworkControl { private List connections = new ArrayList(); private Event stopNetworkEvent = new Event(); - public NetworkControl(LoginData loginData, final IView view) { + public NetworkControl(final LoginData loginData, final IView view) { this.view = view; connectionControl = new ConnectionControl(loginData); - connections.add(connectionControl.getConnectedEvent().add( - new IListener() { - @Override - public void handle() { - view.showGameListPanel(true); - } - })); + connections.add(connectionControl.getConnectedEvent().add(new IListener() { + @Override + public void handle() { + view.getGameListPanel().setChannelName(loginData.getChannelName()); + view.showGameListPanel(true); + + GameData testData = new GameData(UUID.randomUUID(), "NeoRaider"); + testData.setCurrentPlayerCount(2); + testData.setMaxPlayerCount(4); + view.getGameListPanel().addGame(testData); + } + })); connections.add(connectionControl.getConnectionFailedEvent().add( new IListener() { -- cgit v1.2.3