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
|
@ -4,6 +4,26 @@ import jrummikub.model.IHand;
|
|||
import jrummikub.model.ITable;
|
||||
import jrummikub.view.IView;
|
||||
|
||||
public interface TurnControlFactory {
|
||||
public ITurnControl create();
|
||||
public abstract class TurnControlFactory {
|
||||
/**
|
||||
* Type of turn control.
|
||||
*/
|
||||
public enum Type {
|
||||
/** */
|
||||
HUMAN,
|
||||
/** */
|
||||
COMPUTER
|
||||
};
|
||||
|
||||
public abstract ITurnControl create();
|
||||
|
||||
static public TurnControlFactory getFactory(Type type) {
|
||||
switch(type) {
|
||||
case HUMAN:
|
||||
return HumanTurnControl.getFactory();
|
||||
case COMPUTER:
|
||||
return BaseAIControl.getFactory();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue