From 43ace4c18a5aeb0d466ff9180614ba07dc207f33 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Sun, 29 May 2011 21:49:03 +0200 Subject: Added player type selection to the settings panel git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@315 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/PlayerSettings.java | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'src/jrummikub/model') diff --git a/src/jrummikub/model/PlayerSettings.java b/src/jrummikub/model/PlayerSettings.java index 217b1fc..cc1c6e4 100644 --- a/src/jrummikub/model/PlayerSettings.java +++ b/src/jrummikub/model/PlayerSettings.java @@ -2,7 +2,6 @@ package jrummikub.model; import java.awt.Color; -import jrummikub.control.turn.HumanTurnControl; import jrummikub.control.turn.TurnControlFactory; /** @@ -11,7 +10,7 @@ import jrummikub.control.turn.TurnControlFactory; public class PlayerSettings { private String name; private Color color; - private TurnControlFactory turnControlFactory; + private TurnControlFactory.Type turnControlType; /** * Create a new player @@ -27,9 +26,9 @@ public class PlayerSettings { TurnControlFactory turnControlFactory) { this.name = name; this.color = color; - this.turnControlFactory = turnControlFactory; + this.turnControlType = TurnControlFactory.Type.HUMAN; } - + /** * Create a new human player * @@ -41,7 +40,7 @@ public class PlayerSettings { public PlayerSettings(String name, Color color) { this.name = name; this.color = color; - this.turnControlFactory = HumanTurnControl.getFactory(); + this.turnControlType = TurnControlFactory.Type.HUMAN; } /** @@ -83,21 +82,21 @@ public class PlayerSettings { } /** - * Set the player's TurnControlFactory + * Set the player's TurnControlFactory type * - * @param turnControlFactory - * player's TurnControlFactory + * @param turnControlType + * player's TurnControlFactory type */ - public void setTurnControlFactory(TurnControlFactory turnControlFactory) { - this.turnControlFactory = turnControlFactory; + public void setTurnControlType(TurnControlFactory.Type turnControlType) { + this.turnControlType = turnControlType; } /** - * Get the player's TurnControlFactory + * Get the player's TurnControlFactory type * - * @return player's TurnControlFactory + * @return player's TurnControlFactory type */ - public TurnControlFactory getTurnControlFactory() { - return turnControlFactory; + public TurnControlFactory.Type getTurnControlType() { + return turnControlType; } } -- cgit v1.2.3