com.uwsoft.editor.renderer.systems.render.logic.DrawableLogicMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of overlap2d-runtime-libgdx Show documentation
Show all versions of overlap2d-runtime-libgdx Show documentation
overlap2d-runtime-libgdx provides functionality to load, manipulate and render scenes generated by Overlap2D.
The newest version!
package com.uwsoft.editor.renderer.systems.render.logic;
import java.util.HashMap;
import com.badlogic.ashley.core.Entity;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.uwsoft.editor.renderer.factory.EntityFactory;
public class DrawableLogicMapper {
private HashMap logicClassMap;
public DrawableLogicMapper() {
logicClassMap = new HashMap(6);
logicClassMap.put(EntityFactory.IMAGE_TYPE, new TexturRegionDrawLogic());
logicClassMap.put(EntityFactory.LABEL_TYPE, new LabelDrawableLogic());
logicClassMap.put(EntityFactory.NINE_PATCH, new NinePatchDrawableLogic());
logicClassMap.put(EntityFactory.PARTICLE_TYPE, new ParticleDrawableLogic());
logicClassMap.put(EntityFactory.SPRITE_TYPE, new SpriteDrawableLogic());
logicClassMap.put(EntityFactory.SPRITER_TYPE, new SpriterDrawableLogic());
//TODO
logicClassMap.put(EntityFactory.LIGHT_TYPE, new Drawable() {@Override public void draw(Batch batch, Entity entity) {}}); //Empty drawable for not checking on null
}
public void addDrawableToMap(int type, Drawable drawable) {
logicClassMap.put(type, drawable);
}
public Drawable getDrawable(int type){
return logicClassMap.get(type);
}
}