Search in sources :

Example 1 with CustomEmitter

use of de.gurkenlabs.litiengine.graphics.particles.xml.CustomEmitter in project litiengine by gurkenlabs.

the class EmitterMapObjectLoader method load.

@Override
public Collection<IEntity> load(IEnvironment environment, IMapObject mapObject) {
    if (MapObjectType.get(mapObject.getType()) != MapObjectType.EMITTER) {
        throw new IllegalArgumentException("Cannot load a mapobject of the type " + mapObject.getType() + " with a loader of the type " + EmitterMapObjectLoader.class);
    }
    EmitterData data = createEmitterData(mapObject);
    CustomEmitter emitter = new CustomEmitter(data);
    loadDefaultProperties(emitter, mapObject);
    Collection<IEntity> entities = super.load(environment, mapObject);
    entities.add(emitter);
    return entities;
}
Also used : IEntity(de.gurkenlabs.litiengine.entities.IEntity) CustomEmitter(de.gurkenlabs.litiengine.graphics.particles.xml.CustomEmitter) EmitterData(de.gurkenlabs.litiengine.graphics.particles.xml.EmitterData)

Aggregations

IEntity (de.gurkenlabs.litiengine.entities.IEntity)1 CustomEmitter (de.gurkenlabs.litiengine.graphics.particles.xml.CustomEmitter)1 EmitterData (de.gurkenlabs.litiengine.graphics.particles.xml.EmitterData)1