package org.project.item.armors;

import org.project.item.Item;

// TODO: UPDATE IMPLEMENTATION
public abstract class Armor implements Item {
    private int defense;
    private int maxDefense;
    private int durability;
    private int maxDurability;

    private boolean isBroke;

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

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

    // TODO: (BONUS) UPDATE THE REPAIR METHOD
    /*
    Repair weapon durability.
    */
    public void repair() {
        durability = maxDurability;
    }

    /*
    Inspection methods required by Item interface.
    These are left abstract so each concrete weapon
    can define its own identity and value.
    */
    @Override
    public abstract String getName();

    @Override
    public abstract String getDescription();

    @Override
    public abstract int getValue();

    /*
    BONUS: durability getters.
    */
    public int getDurability() {
        return durability;
    }

    public int getMaxDurability() {
        return maxDurability;
    }
    public int getDefense(){
            return defense;
    }
    public boolean getIsBrocke(){
        return isBroke;
    }
}
