package studio.junk.jam.coloritum.ui.animation;

public class Animation {
	public final double					startValue;
	public final double					targetValue;

	public final long					startTime;
	public final long					duration;

	public final AnimatorCallback		callback;

	public final int					fps;
	public final InterpolationFunction	interpolationFunction;

	public final boolean				endless;

	public Animation(double startValue, double targetValue, long duration, AnimatorCallback callback,
			InterpolationFunction interpolationFunction, int fps, boolean endless) {
		this.startTime = System.currentTimeMillis();
		this.startValue = startValue;
		this.targetValue = targetValue;
		this.duration = duration;
		this.callback = callback;
		this.fps = fps;
		this.interpolationFunction = interpolationFunction;
		this.endless = endless;
	}

	public double f(double x) {
		return interpolationFunction.f(x);
	}
}
