Class PropMapObjectLoader
java.lang.Object
de.gurkenlabs.litiengine.environment.MapObjectLoader
de.gurkenlabs.litiengine.environment.PropMapObjectLoader
- All Implemented Interfaces:
IMapObjectLoader
public class PropMapObjectLoader
extends MapObjectLoader
Constructor Summary
Constructors Modifier Constructor Description protected
PropMapObjectLoader()
Method Summary
Modifier and Type Method Description protected Prop
createNewProp(IMapObject mapObject, java.lang.String spriteSheet)
java.util.Collection<IEntity>
load(Environment environment, IMapObject mapObject)
static <T extends Prop>
voidregisterCustomPropType(java.lang.Class<T> propType)
Registers a customProp
implementation that can be automatically provided by thisMapObjectLoader
.Methods inherited from class de.gurkenlabs.litiengine.environment.MapObjectLoader
afterLoad, getMapObjectType, isMatchingType, loadDefaultProperties
Constructor Details
PropMapObjectLoader
protected PropMapObjectLoader()
Method Details
registerCustomPropType
Registers a custom
Prop
implementation that can be automatically provided by thisMapObjectLoader
.This should only be used if the particular implementation doesn't require any additional map object properties to be initialized.
Make sure that the implementation has the following present:- An
AnimationInfo
annotation with one or more sprite prefixes defined - Either an empty constructor or a constructor that takes in the sprite prefix from the loader.
The latter is particularly useful for classes that can have different sprite sheets, i.e. share the same logic but might have a different appearance.
- Type Parameters:
T
- The type of the custom creature implementation.- Parameters:
propType
- The class of the customProp
implementation.
- An
load
createNewProp