summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/turn
diff options
context:
space:
mode:
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;
+ }
}