summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-06-11 03:15:13 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-06-11 03:15:13 +0200
commitf4972b339ba28ee83cee08aa090039edfff12e30 (patch)
tree845a5f99d41a6601ddef353961557bd60ace8e25 /src/jrummikub/view
parentdbd57d42188aa8499211f9a0461fd3511c80f578 (diff)
downloadJRummikub-f4972b339ba28ee83cee08aa090039edfff12e30.tar
JRummikub-f4972b339ba28ee83cee08aa090039edfff12e30.zip
Transmit a whole GameSettings object with game offers
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@410 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/view')
-rw-r--r--src/jrummikub/view/IGameListPanel.java27
-rw-r--r--src/jrummikub/view/impl/GameListPanel.java5
2 files changed, 13 insertions, 19 deletions
diff --git a/src/jrummikub/view/IGameListPanel.java b/src/jrummikub/view/IGameListPanel.java
index 018d931..cb77cdc 100644
--- a/src/jrummikub/view/IGameListPanel.java
+++ b/src/jrummikub/view/IGameListPanel.java
@@ -2,6 +2,7 @@ package jrummikub.view;
import java.util.UUID;
+import jrummikub.model.GameSettings;
import jrummikub.util.IEvent;
import jrummikub.util.IEvent1;
@@ -9,33 +10,25 @@ public interface IGameListPanel {
public static class GameData {
private UUID gameID;
private String host;
- private int currentPlayerCount = 0;
- private int maxPlayerCount = 0;
+ private GameSettings gameSettings;
- public GameData(UUID gameID) {
- this.gameID = gameID;
+ public GameData(UUID gameID, GameSettings settings) {
+ this(gameID, settings, null);
}
- public GameData(UUID gameID, String host) {
+ public GameData(UUID gameID, GameSettings settings, String host) {
this.gameID = gameID;
+ this.gameSettings = settings;
this.host = host;
}
- public void setCurrentPlayerCount(int i) {
- currentPlayerCount = i;
- }
-
- public int getCurrentPlayerCount() {
- return currentPlayerCount;
- }
-
- public void setMaxPlayerCount(int i) {
- maxPlayerCount = i;
+ public void setGameSettings(GameSettings settings) {
+ gameSettings = settings;
}
- public int getMaxPlayerCount() {
- return maxPlayerCount;
+ public GameSettings getGameSettings() {
+ return gameSettings;
}
public String getHost() {
diff --git a/src/jrummikub/view/impl/GameListPanel.java b/src/jrummikub/view/impl/GameListPanel.java
index dae0f27..99807f8 100644
--- a/src/jrummikub/view/impl/GameListPanel.java
+++ b/src/jrummikub/view/impl/GameListPanel.java
@@ -191,8 +191,9 @@ class GameListPanel extends JPanel implements IGameListPanel {
GameData gameData = (GameData) value;
host = gameData.getHost();
- playerCount = gameData.getCurrentPlayerCount() + "/"
- + gameData.getMaxPlayerCount();
+ /*playerCount = gameData.getCurrentPlayerCount() + "/"
+ + gameData.getMaxPlayerCount();*/
+ playerCount = String.valueOf(gameData.getGameSettings().getPlayerList().size());
} else {
host = String.valueOf(value);
}