This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
JRummikub/src/jrummikub/control/turn/TurnControlFactory.java

31 lines
530 B
Java
Raw Normal View History

package jrummikub.control.turn;
/**
* Creates a turn control for the active player, regarding if layer is human or
* computer
*
*/
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;
}
}