package de.frajul.endlessroll.entities.guis;

import de.frajul.endlessroll.data.Vector;
import de.frajul.endlessroll.entities.textures.Texture;
import de.frajul.endlessroll.main.GameLog;

public class Progressbar extends Gui {

    private float maxTime;
    private float progress;

    public Progressbar(Texture texture, Vector position, float width, float height, float maxTime) {
        super(texture, position, width, height);
        this.maxTime = maxTime;
    }

    public void update(float frameTime){
        progress += frameTime / maxTime;
        if (progress >= 1f)
            progress = 1f;
    }

    public boolean hasFinished(){
        return progress == 1;
    }

    public float getProgress() {
        return progress;
    }

    public void setProgress(float progress) {
        this.progress = progress;
    }

    public float getMaxTime() {
        return maxTime;
    }

    public void setMaxTime(float maxTime) {
        this.maxTime = maxTime;
    }
}
