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