public class Armor // represents a piece of armor as used in the adventure game, every Fighter will have 1 or 2 pieces, { // the first will be worn (e.g., chain mail or hide) the second is a shield if any private String type; // description of the type of Armor private int protection; // determines how hard an opponent must strike this Fighter before a hit is recorded public Armor() // no-arg constructor, assume minimal defense { type="unknown"; protection=1; } public Armor(String t, int p) { type=t; protection=p; } // accessors public String getArmor() {return type;} public int getProtection() {return protection;} // determine if other Armor is better than this Armor for replacement public boolean isBetter(Armor other) { // cannot take armor that is part of a body (e.g., Skin, Hide) if(!other.getArmor().equals("Skin")&&!other.getArmor().equals("Hide")&&other.getProtection()>protection) return true; else return false; } }