for (Enumeration e = getMisc(); e.hasMoreElements(); ) { Mounted m = (Mounted)e.nextElement();
for (Mounted m: getMisc()) {
    public boolean hasAimModeTargComp() {        if(hasActiveEiCockpit()) {            if(this instanceof Mech) {                if(((Mech)this).getCockpitStatus() == Mech.COCKPIT_AIMED_SHOT) {                    return true;                }            } else {                return true;            }        }        for (Enumeration e = getMisc(); e.hasMoreElements(); ) {            Mounted m = (Mounted)e.nextElement();            if (m.getType() instanceof MiscType && m.getType().hasFlag(MiscType.F_TARGCOMP) && m.curMode().equals("Aimed shot")) {                return !(m.isDestroyed() || m.isMissing() || m.isBreached());            }        }        return false;    }