package jrummikub.model; import java.awt.Color; import java.io.Serializable; import jrummikub.control.turn.TurnControlFactory; /** * The settings of a player */ public class PlayerSettings implements Serializable { /** * Type of turn control. */ public enum Type { /** */ HUMAN, /** */ COMPUTER, /** */ VACANT, /** */ NETWORK } private static final long serialVersionUID = 1963640115089275992L; private String name; private Color color; private Type turnControlType; /** * Create a new human player * * @param name * the player's name * @param color * the player's color */ public PlayerSettings(String name, Color color) { this.name = name; this.color = color; this.turnControlType = Type.HUMAN; } /** * Returns the player's color * * @return the color */ public Color getColor() { return color; } /** * Returns the player's name * * @return the name */ public String getName() { return name; } /** * Sets the player's color * * @param color * the new color */ public void setColor(Color color) { this.color = color; } /** * Sets the player's name * * @param name * the new name */ public void setName(String name) { this.name = name; } /** * Set the player's TurnControlFactory type * * @param turnControlType * player's TurnControlFactory type */ public void setTurnControlType(Type turnControlType) { this.turnControlType = turnControlType; } /** * Get the player's TurnControlFactory type * * @return player's TurnControlFactory type */ public Type getTurnControlType() { return turnControlType; } }