package de.frajul.endlessroll.user;

import java.util.ArrayList;
import java.util.List;

import de.frajul.endlessroll.R;
import de.frajul.endlessroll.entities.tools.ToolType;
import de.frajul.endlessroll.main.GameActivity;
import de.frajul.endlessroll.views.BountyMessage;

/**
 * Created by Julian on 26.01.2017.
 */

public class LevelBounty {

    private int starCount = 0;
    private int energyCount = 0;
    private ToolType toolType;
    private boolean toolSlot = false;

    public LevelBounty(int starCount, int energyCount, ToolType toolType, boolean toolSlot) {
        this.starCount = starCount;
        this.energyCount = energyCount;
        this.toolType = toolType;
        this.toolSlot = toolSlot;
    }

    public List<BountyMessage> createBountyMessages(GameActivity gameActivity, BountyMessage.ScreenSwitchCaller caller) {
        List<BountyMessage> list = new ArrayList();
        if (starCount != 0)
            list.add(new BountyMessage(gameActivity, BountyMessage.MessageType.STARS, starCount + "",
                    caller, R.drawable.currency_star));
        if (energyCount != 0)
            list.add(new BountyMessage(gameActivity, BountyMessage.MessageType.ENERGY, energyCount + "",
                    caller, R.drawable.currency_energy));
        if (toolType != null)
            list.add(new BountyMessage(gameActivity, BountyMessage.MessageType.TOOL, gameActivity.getString(toolType.getName()),
                    caller, toolType.getButtonDrawable()));
        if (toolSlot)
            list.add(new BountyMessage(gameActivity, BountyMessage.MessageType.TOOL_SLOT, null, caller,
                    R.drawable.tools_button_unlocked));
        return list;
    }

    public ToolType getToolType() {
        return toolType;
    }

    public boolean isToolSlot() {
        return toolSlot;
    }

    public int getStarCount() {
        return starCount;
    }

    public int getEnergyCount() {
        return energyCount;
    }
}
