if (en instanceof Tank) { if (en.hasTargComp()) { Enumeration equip = en.getEquipment(); while (equip.hasMoreElements()) { Mounted m = (Mounted)equip.nextElement(); if (m.getType() instanceof MiscType && m.getType().hasFlag(MiscType.F_TARGCOMP) ) { StringBuffer sb = new StringBuffer(32); sb.append(m.isDestroyed() ? "*" : "").append(m.isBreached() ? "x" : "").append(m.getDesc()); if (m.getType().hasModes()) { sb.append(" (").append(m.curMode()).append(")"); } slotList.add(sb.toString()); } } } }
    public void displaySlots() {        int loc = locList.getSelectedIndex();        slotList.removeAll();        for (int i = 0; i < en.getNumberOfCriticals(loc); i++) {            final CriticalSlot cs = en.getCritical(loc, i);            StringBuffer sb = new StringBuffer(32);            if(cs == null) {                sb.append("---");            } else {                switch(cs.getType()) {                case CriticalSlot.TYPE_SYSTEM :                    sb.append(cs.isDestroyed() ? "*" : "")                        .append(cs.isBreached() ? "x" : "");                    // Protomechs have different systme names.                    if ( en instanceof Protomech ) {                        sb.append(Protomech.systemNames[cs.getIndex()]);                    } else {                        sb.append(Mech.systemNames[cs.getIndex()]);                    }                    break;                case CriticalSlot.TYPE_EQUIPMENT :                    Mounted m = en.getEquipment(cs.getIndex());                    sb.append(cs.isDestroyed() ? "*" : "").append(cs.isBreached() ? "x" : "").append(m.getDesc());                    if (m.getType().hasModes()) {                        sb.append(" (").append(m.curMode()).append(")");                    }                    break;                }            }            slotList.add(sb.toString());        }    }