for (Enumeration i = weaponList.elements(); i.hasMoreElements();) { Mounted mounted = (Mounted)i.nextElement();
for(Mounted mounted : getWeaponList()) {
    public int calculateBattleValue() {        double dBV = 0;        // BV is factor of anti-Mek training, movement type and weapon type.        if ( this.antiMek ) {            if (this.weapons == INF_RIFLE) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 32;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 42;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 46;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else if (this.weapons == INF_MG) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 47;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 63;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 62;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else if (this.weapons == INF_FLAMER) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 41;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 54;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 51;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else if (this.weapons == INF_LASER) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 60;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 70;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 71;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else if (this.weapons == INF_SRM) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 60;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 70;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 71;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else if (this.weapons == INF_LRM) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 56;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 75;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 87;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else throw new IllegalArgumentException                    ( "Unknown infantry weapon: " + this.weapons );        } // End anti-Mek-trained        else {            if (this.weapons == INF_RIFLE) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 23;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 28;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 29;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else if (this.weapons == INF_MG) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 31;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 39;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 37;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else if (this.weapons == INF_FLAMER) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 28;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 35;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 32;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else if (this.weapons == INF_LASER) {                  if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 37;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 42;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 41;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else if (this.weapons == INF_SRM) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 60;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 70;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 71;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else if (this.weapons == INF_LRM) {                if ( IEntityMovementMode.INF_LEG == this.getMovementMode() )                    dBV = 56;                else if ( IEntityMovementMode.INF_MOTORIZED == this.getMovementMode() )                    dBV = 75;                else if ( IEntityMovementMode.INF_JUMP == this.getMovementMode() )                    dBV = 87;                else throw new IllegalArgumentException                        ( "Unknown movement type: " + this.getMovementMode() );            } else throw new IllegalArgumentException                    ( "Unknown infantry weapon: " + this.weapons );        } // End not-anti-Mek        // add BV of field guns        for (Enumeration i = weaponList.elements(); i.hasMoreElements();) {            Mounted mounted = (Mounted)i.nextElement();            WeaponType wtype = (WeaponType)mounted.getType();            if(!wtype.hasFlag(WeaponType.F_INFANTRY))                dBV += wtype.getBV(this);        }        // Adjust for missing troopers        dBV = dBV * getInternalRemainingPercent();        // Possibly adjust for TAG and Arrow IV.        if (getsTagBVPenalty()) {            dBV += 200;        }        if (getsHomingBVPenalty()) {            dBV += 200;        }        // adjust for crew        double pilotFactor = crew.getBVSkillMultiplier();        dBV = dBV * pilotFactor;        return (int)Math.round(dBV);    } // End public int calculateBattleValue()