Define getter for ClientGameLobby

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>
This commit is contained in:
Jamin W. Collins
2018-02-13 18:41:56 -07:00
parent 367fcad53c
commit e8c9c8b90c
3 changed files with 14 additions and 0 deletions

View File

@@ -1,9 +1,11 @@
package forge.interfaces;
import forge.match.GameLobby.GameLobbyData;
import forge.net.client.ClientGameLobby;
public interface ILobbyListener {
void message(String source, String message);
void update(GameLobbyData state, int slot);
void close();
ClientGameLobby getLobby();
}

View File

@@ -76,6 +76,10 @@ public class NetConnectUtil {
public final void close() {
// NO-OP, server can't receive close message
}
@Override
public ClientGameLobby getLobby() {
return null;
}
});
chatInterface.setGameClient(new IRemote() {
@Override
@@ -128,6 +132,10 @@ public class NetConnectUtil {
SOptionPane.showMessageDialog("Your connection to the host (" + url + ") was interrupted.", "Error", FSkinProp.ICO_WARNING);
onlineLobby.setClient(null);
}
@Override
public ClientGameLobby getLobby() {
return lobby;
}
});
view.setPlayerChangeListener(new IPlayerChangeListener() {
@Override

View File

@@ -105,6 +105,10 @@ public class FGameClient implements IToServer {
return replies.get(event.getId());
}
List<ILobbyListener> getLobbyListeners() {
return lobbyListeners;
}
public void addLobbyListener(final ILobbyListener listener) {
lobbyListeners.add(listener);
}