summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/util
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-06-13 23:31:47 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-06-13 23:31:47 +0200
commitf5a05f2c8d42b9f5978d8118c065fa8a871ec2fd (patch)
tree041fb50e7384618ed2202628f12df602e8c40394 /src/jrummikub/util
parent570187c95000afd1ac9f6d6e8bb5cab30b984e87 (diff)
downloadJRummikub-f5a05f2c8d42b9f5978d8118c065fa8a871ec2fd.tar
JRummikub-f5a05f2c8d42b9f5978d8118c065fa8a871ec2fd.zip
Kommentare und kleinere Umbauten
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@426 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/util')
-rw-r--r--src/jrummikub/util/GameData.java81
-rw-r--r--src/jrummikub/util/LoginData.java35
2 files changed, 116 insertions, 0 deletions
diff --git a/src/jrummikub/util/GameData.java b/src/jrummikub/util/GameData.java
new file mode 100644
index 0000000..1ad651f
--- /dev/null
+++ b/src/jrummikub/util/GameData.java
@@ -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;
+ }
+} \ No newline at end of file
diff --git a/src/jrummikub/util/LoginData.java b/src/jrummikub/util/LoginData.java
index fb295c1..50ae468 100644
--- a/src/jrummikub/util/LoginData.java
+++ b/src/jrummikub/util/LoginData.java
@@ -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;
}