package org.project.item.consumables;

import org.project.entity.Entity;
import org.project.item.Item;

public abstract class Consumable implements Item {
    protected String name;
    protected int quantity;

    public Consumable(String name, int quantity) {
        this.name = name;
        this.quantity = quantity;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public int getQuantity() {
        return quantity;
    }

    @Override
    public void addQuantity(int amount) {
        this.quantity += amount;
    }

    @Override
    public boolean canUse() {
        return quantity > 0;
    }

    @Override
    public abstract void use(Entity target);
}
