summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/turn
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-05-29 21:49:03 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-05-29 21:49:03 +0200
commit43ace4c18a5aeb0d466ff9180614ba07dc207f33 (patch)
tree9a6497b0ae1c6036dc8abf44cbad96bd352ac480 /src/jrummikub/control/turn
parent08e9b28f3b679a8f511ca40f5b8b6aa5ec8aa188 (diff)
downloadJRummikub-43ace4c18a5aeb0d466ff9180614ba07dc207f33.tar
JRummikub-43ace4c18a5aeb0d466ff9180614ba07dc207f33.zip
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
Diffstat (limited to 'src/jrummikub/control/turn')
-rw-r--r--src/jrummikub/control/turn/TurnControlFactory.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/jrummikub/control/turn/TurnControlFactory.java b/src/jrummikub/control/turn/TurnControlFactory.java
index 48c028e..ecfc5ff 100644
--- a/src/jrummikub/control/turn/TurnControlFactory.java
+++ b/src/jrummikub/control/turn/TurnControlFactory.java
@@ -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;
+ }
}