package pathgame.gameplay;

/**
 * A container for holding an energy cost from the step of the player with a
 * lifetime for showing in the HUD
 *
 * @author julia
 */
public class MinusStepsValues
{
    private final int minusValue;
    private int lifeTime = 0;

    /**
     * Contructor initializing a new energyCost with a lifetime
     *
     * @param minusValue energyCost of a step of the player
     */
    public MinusStepsValues(int minusValue)
    {
        this.minusValue = minusValue;
    }

    /**
     * Returns the energyCost value
     *
     * @return energyCost value
     */
    public int getValue()
    {
        return minusValue;
    }

    /**
     * Returns the energyCost lifetime
     *
     * @return energyCost lifetime
     */
    public int getLifeTime()
    {
        return lifeTime;
    }

    /**
     * Recalculates the lifetime every gametick and returns if energyCost is
     * still alive
     *
     * @return if energyCost is still alive
     */
    public boolean tick()
    {
        lifeTime++;
        return lifeTime >= 10;
    }
}
