package de.frajul.endlessroll.entities.shapes;

import android.content.Context;

import de.frajul.endlessroll.R;
import de.frajul.endlessroll.levels.LevelManager;

/**
 * Created by Julian on 30.10.2017.
 */

public class CollectEnergyTask extends Task {

    public CollectEnergyTask(int condition) {
        super(condition);
    }

    @Override
    protected boolean checkConditionFulfilled(LevelManager levelManager) {
        return levelManager.getTotalCollectedEnergyCount() >= condition;
    }

    @Override
    public String toString(Context context, LevelManager levelManager) {
        if (conditionFulfilled) {
            return context.getString(R.string.task_collect_energy_format_d, condition);
        }
        return context.getString(R.string.task_collect_energy_progress_format_ddd, condition,
                levelManager.getTotalCollectedEnergyCount(), condition);
    }
}
