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
This commit is contained in:
parent
dbd57d4218
commit
f4972b339b
5 changed files with 22 additions and 41 deletions
|
@ -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 void setGameSettings(GameSettings settings) {
|
||||
gameSettings = settings;
|
||||
}
|
||||
|
||||
public int getCurrentPlayerCount() {
|
||||
return currentPlayerCount;
|
||||
}
|
||||
|
||||
public void setMaxPlayerCount(int i) {
|
||||
maxPlayerCount = i;
|
||||
}
|
||||
|
||||
public int getMaxPlayerCount() {
|
||||
return maxPlayerCount;
|
||||
public GameSettings getGameSettings() {
|
||||
return gameSettings;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Reference in a new issue