T
- The enum containing all types.S
- The setup type used.public abstract class FactoryGame<T extends java.lang.Enum<T>,S extends SetupGame>
extends java.lang.Object
SetupGame
considering an input enumeration. This way it is possible to create new
instances of object related to their type by sharing the same data.
Sample implementation:
public class Factory extends FactoryGame<EntityType, SetupGame> { public Factory() { super(EntityType.class); load(); } @Override protected SetupGame createSetup(EntityType type) { return new SetupGame(Media.get(type.name() + ".xml")); } }
Constructor and Description |
---|
FactoryGame(java.lang.Class<T> enumType)
Constructor.
|
public FactoryGame(java.lang.Class<T> enumType)
enumType
- The class of the enum type defined.