summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/util/GameData.java
blob: 1ad651f5c8e2a6eb2b0ec7740a495ef75fddfc69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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;
	}
}