com.uwsoft.editor.renderer.systems.ScriptSystem 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;
import com.badlogic.ashley.core.ComponentMapper;
import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.Family;
import com.badlogic.ashley.systems.IteratingSystem;
import com.uwsoft.editor.renderer.components.ScriptComponent;
import com.uwsoft.editor.renderer.scripts.IScript;
/**
* Created by azakhary on 6/19/2015.
*/
public class ScriptSystem extends IteratingSystem {
private ComponentMapper scriptComponentComponentMapper = ComponentMapper.getFor(ScriptComponent.class);
public ScriptSystem() {
super(Family.all(ScriptComponent.class).get());
}
@Override
protected void processEntity(Entity entity, float deltaTime) {
for(IScript script: scriptComponentComponentMapper.get(entity).scripts) {
script.act(deltaTime);
}
}
}