Kommentare und kleinere Umbauten
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@426 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
570187c950
commit
f5a05f2c8d
12 changed files with 231 additions and 70 deletions
81
src/jrummikub/util/GameData.java
Normal file
81
src/jrummikub/util/GameData.java
Normal file
|
@ -0,0 +1,81 @@
|
|||
package jrummikub.util;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import jrummikub.model.GameSettings;
|
||||
|
||||
/**
|
||||
* Class summarizing the game data important for unique and sensible network
|
||||
* representation and use
|
||||
*/
|
||||
public class GameData {
|
||||
private UUID gameID;
|
||||
private String host;
|
||||
private GameSettings gameSettings;
|
||||
|
||||
/**
|
||||
* Creates new game data
|
||||
*
|
||||
* @param gameID
|
||||
* unique gameID
|
||||
* @param settings
|
||||
* game settings (serialized)
|
||||
*/
|
||||
public GameData(UUID gameID, GameSettings settings) {
|
||||
this(gameID, settings, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new game data
|
||||
*
|
||||
* @param gameID
|
||||
* unique gameID
|
||||
* @param settings
|
||||
* game settings (serialized)
|
||||
* @param host
|
||||
* name of the player offering the game
|
||||
*/
|
||||
public GameData(UUID gameID, GameSettings settings, String host) {
|
||||
this.gameID = gameID;
|
||||
this.gameSettings = settings;
|
||||
this.host = host;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the game settings
|
||||
*
|
||||
* @param settings
|
||||
* game settings after adjustment
|
||||
*/
|
||||
public void setGameSettings(GameSettings settings) {
|
||||
gameSettings = settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for game settings
|
||||
*
|
||||
* @return returns game settings
|
||||
*/
|
||||
public GameSettings getGameSettings() {
|
||||
return gameSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for host name
|
||||
*
|
||||
* @return host user name
|
||||
*/
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for gameID
|
||||
*
|
||||
* @return gameID
|
||||
*/
|
||||
public UUID getGameID() {
|
||||
return gameID;
|
||||
}
|
||||
}
|
|
@ -1,11 +1,26 @@
|
|||
package jrummikub.util;
|
||||
|
||||
/**
|
||||
* Data needed for the login in one data type (name, server, password, channel)
|
||||
*/
|
||||
public class LoginData {
|
||||
private String userName;
|
||||
private String serverName;
|
||||
private String password;
|
||||
private String channelName;
|
||||
|
||||
/**
|
||||
* Creates a new set of login data
|
||||
*
|
||||
* @param userName
|
||||
* user name in channel, player name in game
|
||||
* @param serverName
|
||||
* server of the user account specified in user name
|
||||
* @param password
|
||||
* for account with user name on server
|
||||
* @param channelName
|
||||
* channel in which games can be offered and played
|
||||
*/
|
||||
public LoginData(String userName, String serverName, String password,
|
||||
String channelName) {
|
||||
this.userName = userName;
|
||||
|
@ -14,18 +29,38 @@ public class LoginData {
|
|||
this.channelName = channelName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for user name
|
||||
*
|
||||
* @return user name
|
||||
*/
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for server name
|
||||
*
|
||||
* @return server name
|
||||
*/
|
||||
public String getServerName() {
|
||||
return serverName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for password
|
||||
*
|
||||
* @return password
|
||||
*/
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for channel name
|
||||
*
|
||||
* @return channel name
|
||||
*/
|
||||
public String getChannelName() {
|
||||
return channelName;
|
||||
}
|
||||
|
|
Reference in a new issue