package UserInterface.Animation;

/**
 * Makes shit get big, makes shit get small.
 */
public class SizeAnimation extends Animation {

    protected int iW, iH, fW, fH, cW, cH;

    public SizeAnimation(long period, int paceType, boolean loop, int iW, int iH, int fW, int fH) {
        super(period, paceType, loop);

        this.iW = iW;
        this.iH = iH;
        this.fW = fW;
        this.fH = fH;
        this.cW = iW;
        this.cH = iH;
    }

    @Override
    protected void updateAnimation(double p) {
        cW = (int)Math.round((fW - iW)*p) + iW;
        cH = (int)Math.round((fH - iH)*p) + iH;
    }

    public int getWidth() {
        return cW;
    }

    public int getHeight() {
        return cH;
    }
}
