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
This commit is contained in:
parent
08e9b28f3b
commit
43ace4c18a
4 changed files with 155 additions and 88 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue