package org.project.item.armors;

public abstract class Armor {
    private int defense;
    private int durability;
    private int durabilityCost;

    private boolean isBroke;

    public Armor(int defense, int durability, int durabilityCost) {
        this.defense = defense;
        this.durability = durability;
        this.durabilityCost = durabilityCost;
    }

    public void use(){
        durability -= durabilityCost;
        System.out.println("Used Armor.");
        checkBreak();
    }

    public void checkBreak() {
        if (durability <= 0) {
            isBroke = true;
            defense = 0;
            durability = 0;
        }
    }


    public int getDefense() {

        return defense;
    }

    public int getDurability() {

        return durability;
    }

    public boolean isBroke() {

        return isBroke;
    }
}
