private Entity setupGunEmplacement() { Entity testEntity = Mockito.mock(GunEmplacement.class); Mockito.when(testEntity.calculateBattleValue()).thenCallRealMethod(); Mockito.when(testEntity.calculateBattleValue(Mockito.anyBoolean(), Mockito.anyBoolean())).thenCallRealMethod(); Mockito.when(testEntity.getTotalArmor()).thenReturn(100); ArrayList<Mounted> equipment = new ArrayList<Mounted>(2); WeaponType ppcType = Mockito.mock(WeaponType.class); Mockito.when(ppcType.getBV(Mockito.any(Entity.class))).thenReturn(50.0); Mounted ppc = Mockito.mock(Mounted.class); Mockito.when(ppc.getType()).thenReturn(ppcType); Mockito.when(ppc.isDestroyed()).thenReturn(false); equipment.add(ppc); equipment.add(ppc); Mockito.when(testEntity.getEquipment()).thenReturn(equipment); Mockito.when(testEntity.getWeaponList()).thenReturn(equipment); Mockito.when(testEntity.getAmmo()).thenReturn(new ArrayList<Mounted>(0)); return testEntity; }
for (Mounted mounted : getWeaponList()) { WeaponType wtype = (WeaponType) mounted.getType(); double dBV = wtype.getBV(this); String key = wtype.getAmmoType() + ":" + wtype.getRackSize(); if (!weaponsForExcessiveAmmo.containsKey(key)) { weaponsForExcessiveAmmo.put(key, wtype.getBV(this)); } else { weaponsForExcessiveAmmo.put(key, wtype.getBV(this) + weaponsForExcessiveAmmo.get(key));
int arc = getWeaponArc(getEquipmentNum(mounted)); arcNameLookup.put(arc, getLocationName(loc)); double dBV = wtype.getBV(this); String key = wtype.getAmmoType() + ":" + wtype.getRackSize() + ";" + arc; if (!weaponsForExcessiveAmmo.containsKey(key)) { weaponsForExcessiveAmmo.put(key, wtype.getBV(this)); } else { weaponsForExcessiveAmmo.put(key, wtype.getBV(this) + weaponsForExcessiveAmmo.get(key));
for (Mounted mounted : getWeaponList()) { WeaponType wtype = (WeaponType) mounted.getType(); double dBV = wtype.getBV(this); String key = wtype.getAmmoType() + ":" + wtype.getRackSize(); if (!weaponsForExcessiveAmmo.containsKey(key)) { weaponsForExcessiveAmmo.put(key, wtype.getBV(this)); } else { weaponsForExcessiveAmmo.put(key, wtype.getBV(this) + weaponsForExcessiveAmmo.get(key));
for (Mounted weapon : weapons) { WeaponType wtype = (WeaponType) weapon.getType(); double dBV = wtype.getBV(this); bvText.append(endRow); double dBV = wtype.getBV(this); String key = wtype.getAmmoType() + ":" + wtype.getRackSize(); if (!weaponsForExcessiveAmmo.containsKey(key)) { weaponsForExcessiveAmmo.put(key, wtype.getBV(this)); } else { weaponsForExcessiveAmmo.put(key, wtype.getBV(this) + weaponsForExcessiveAmmo.get(key));
continue; double dBV = wtype.getBV(this); bvText.append(endRow); double dBV = wtype.getBV(this); if (hasWorkingMisc(MiscType.F_DRONE_OPERATING_SYSTEM)) { dBV *= 0.8; String key = wtype.getAmmoType() + ":" + wtype.getRackSize(); if (!weaponsForExcessiveAmmo.containsKey(key)) { weaponsForExcessiveAmmo.put(key, wtype.getBV(this)); } else { weaponsForExcessiveAmmo.put(key, wtype.getBV(this) + weaponsForExcessiveAmmo.get(key));
for (Mounted mounted : getWeaponList()) { WeaponType wtype = (WeaponType) mounted.getType(); double dBV = wtype.getBV(this);