WeaponType wtype = (WeaponType)mounted.getType(); for (Enumeration i = getAmmo(); i.hasMoreElements();) { Mounted mountedAmmo = (Mounted)i.nextElement();
for(Mounted mountedAmmo : getAmmo()) {
    public void loadWeaponWithSameAmmo(Mounted mounted) {        WeaponType wtype = (WeaponType)mounted.getType();        for (Enumeration i = getAmmo(); i.hasMoreElements();) {            Mounted mountedAmmo = (Mounted)i.nextElement();            if (loadWeaponWithSameAmmo(mounted, mountedAmmo))                return;        }        //fall back to use any ammo        loadWeapon(mounted);    }