package org.project.item.consumables;

import org.project.entity.Entity;

public abstract class Consumable
{

    protected String name;
    protected String description;
    protected int restoreAmount;
    protected boolean percentageBased;

    public Consumable(String name, String description, int restoreAmount, boolean percentageBased)
    {
        this.name = name;
        this.description = description;
        this.restoreAmount = restoreAmount;
        this.percentageBased = percentageBased;
    }


    public abstract void use(Entity target);


    public String getName()
    {
        return name;
    }

    public int getRestoreAmount()
    {
        return restoreAmount;
    }

    public String getDescription()
    {
        return description;
    }

    public boolean isPercentageBased()
    {
        return percentageBased;
    }

    @Override
    public String toString()
    {
        return name + " (" + description + ")";
    }
}
