/** * @return The <code>MiscType</code> for this armor. */ public EquipmentType getArmorEqType() { String name = EquipmentType.getArmorTypeName(type, isClan); return EquipmentType.get(name); } }
public static TechAdvancement getStructureTechAdvancement(int at, boolean clan) { if (at == T_STRUCTURE_STANDARD) { return TA_STANDARD_STRUCTURE; } String structureName = EquipmentType.getStructureTypeName(at, clan); EquipmentType structure = EquipmentType.get(structureName); if (structure != null) { return structure.getTechAdvancement(); } return TA_NONE; }
public EquipmentType getType() { return (null != type) ? type : (type = EquipmentType.get(typeName)); }
/** * @return The <code>MiscType</code> for this armor. */ public EquipmentType getArmorEqType() { String name = EquipmentType.getArmorTypeName(type, isClan); return EquipmentType.get(name); } }
/** * @return The <code>MiscType</code> for this armor. */ public EquipmentType getArmor() { String name = EquipmentType.getArmorTypeName(type, isClan); return EquipmentType.get(name); } }
public static List<EquipmentType> allJJs(boolean industrialOnly) { List<EquipmentType> retVal = new ArrayList<>(); for (MechJumpJets jj : values()) { if (jj.industrial || !industrialOnly) { retVal.add(EquipmentType.get(jj.internalName)); } } return retVal; }
/** * @return The {@link MiscType} for this armor. */ public EquipmentType getArmorEqType() { String name = EquipmentType.getArmorTypeName(type, isClan); return EquipmentType.get(name); }
public static List<EquipmentType> allSystems() { List<EquipmentType> retVal = new ArrayList<>(); for (BAMotiveSystems ms : values()) { retVal.add(EquipmentType.get(ms.internalName)); } return retVal; }
/** * @return The <code>MiscType</code> for this armor. */ public EquipmentType getArmorEqType() { String name = EquipmentType.getArmorTypeName(type, isClan); return EquipmentType.get(name); } }
private AmmoType getAmmoType(long ammo, HMVTechType techType) { AmmoType ammoType = null; String ammoName = getAmmoName(ammo, techType); if (ammoName != null) { ammoType = (AmmoType) EquipmentType.get(ammoName); } return ammoType; } /*
public void setArmorType(int armType, boolean addMount) { super.setArmorType(armType); if ((armType == EquipmentType.T_ARMOR_STEALTH_VEHICLE) && addMount) { try { this.addEquipment( EquipmentType.get(EquipmentType.getArmorTypeName(EquipmentType.T_ARMOR_STEALTH_VEHICLE, false)), LOC_AFT); } catch (LocationFullException e) { // this should never happen } } }
private EquipmentType getEquipmentType(long equipment, HMVTechType techType) { EquipmentType equipmentType = null; String equipmentName = getEquipmentName(equipment, techType); if (equipmentName != null) { equipmentType = EquipmentType.get(equipmentName); if (equipmentType == null) { failedEquipment.add(equipmentName); } } else { failedEquipment.add("Unknown Equipment (" + Long.toHexString(equipment) + ")"); } return equipmentType; }
public void setArmorType(int armType, boolean addMount) { super.setArmorType(armType); if ((armType == EquipmentType.T_ARMOR_STEALTH_VEHICLE) && addMount) { try { this.addEquipment(EquipmentType.get(EquipmentType .getArmorTypeName( EquipmentType.T_ARMOR_STEALTH_VEHICLE, false)), LOC_BODY); } catch (LocationFullException e) { // this should never happen } } }
public static List<EquipmentType> allJJs() { return Arrays.stream(values()) .map(jj -> EquipmentType.get(jj.internalName)) .collect(Collectors.toList()); } }
private static void createArtilleryFireLance() { FormationType ft = new FormationType("Artillery Fire", "Fire"); ft.allowedUnitTypes = FLAG_GROUND; ft.missionRoles.add(MissionRole.MIXED_ARTILLERY); ft.otherCriteria.add(new CountConstraint(2, ms -> ms.getEquipmentNames().stream().map(name -> EquipmentType.get(name)) .anyMatch(eq -> eq instanceof ArtilleryWeapon), "Artillery")); ft.reportMetrics.put("Artillery", ms -> ft.otherCriteria.get(0).criterion.test(ms)); allFormationTypes.put(ft.name, ft); }
/** * Damage that the specified platoon does with explosives */ public static int getDamageFor(Entity entity) { if (!(entity instanceof Infantry)) return 0; Infantry inf = (Infantry) entity; InfantryWeapon srmWeap = (InfantryWeapon) EquipmentType .get("SRM Launcher (Std, Two-Shot)"); int dmg = (int) Math.round(srmWeap.getInfantryDamage() * inf.getShootingStrength()); int numTurns = Math.min(6, inf.turnsLayingExplosives); return dmg * numTurns; }
public static EquipmentType getEquipment(EntityMovementMode mode) { for (BAMotiveSystems ms : values()) { if (ms.getMovementMode() == mode) { return EquipmentType.get(ms.internalName); } } return null; }
@Test public void testNoArmMountsForQuads() { Protomech mockProto = createGenericMockProto(); when(mockProto.isQuad()).thenReturn(true); Mounted m = new Mounted(mockProto, EquipmentType.get("CLERSmallLaser")); m.setLocation(Protomech.LOC_LARM); ArrayList<Mounted> eqList = new ArrayList<>(); eqList.add(m); when(mockProto.getEquipment()).thenReturn(eqList); TestProtomech test = new TestProtomech(mockProto, option, null); assertTrue(test.hasIllegalEquipmentCombinations(new StringBuffer())); }
@Test public void testExcessiveSlots() { Protomech mockProto = createGenericMockProto(); Mounted m = new Mounted(mockProto, EquipmentType.get("CLERSmallLaser")); m.setLocation(Protomech.LOC_TORSO); ArrayList<Mounted> eqList = new ArrayList<>(); eqList.add(m); when(mockProto.getEquipment()).thenReturn(eqList); TestProtomech test = new TestProtomech(mockProto, option, null); assertFalse(test.hasIllegalEquipmentCombinations(new StringBuffer())); m.setLocation(Protomech.LOC_HEAD); assertTrue(test.hasIllegalEquipmentCombinations(new StringBuffer())); }