package org.project.item.armors;

import org.project.item.Item;

public abstract class Armor implements Item {
    private int defense;
    private int maxDefense;


    public Armor(int defense) {
        this.defense = defense;
        this.maxDefense = defense;
    }



    public void repair() {
        defense = maxDefense;
    }

    public int getDefense() {
        return defense;
    }

    public void setDefense(int defense) {
        this.defense = defense;
    }


    public boolean checkBrake() {
        return defense <= 0;
    }

    @Override
    public String getName() {
        return this.getClass().getSimpleName();
    }

    @Override
    public void use() {
        System.out.println(this.getClass().getSimpleName() + " equipped");
    }

}
