package com.uwsoft.editor.renderer.systems.action.logic;
import com.badlogic.ashley.core.Entity;
import com.uwsoft.editor.renderer.components.TransformComponent;
import com.uwsoft.editor.renderer.systems.action.data.ActionData;
import com.uwsoft.editor.renderer.systems.action.data.RotateByData;
import com.uwsoft.editor.renderer.utils.ComponentRetriever;
/**
* Created by ZeppLondon on 10/16/2015.
*/
public class RotateByAction<T extends RotateByData> extends RelativeTemporalAction<T> {
@Override
protected void updateRelative(float percentDelta, Entity entity, T actionData) {
TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class);
transformComponent.rotation += actionData.amount * percentDelta;
}
}