public double getCargoCapacity() { double capacity = 0; for (Bay bay : entity.getTransportBays()) { if (bay instanceof CargoBay) { capacity += bay.getCapacity(); } if (bay instanceof PillionSeatCargoBay) { capacity += bay.getCapacity(); } if (bay instanceof StandardSeatCargoBay) { capacity += bay.getCapacity(); } } return capacity; }
public double getRefrigeratedCargoCapacity() { double capacity = 0; for (Bay bay : entity.getTransportBays()) { if (bay instanceof RefrigeratedCargoBay) { capacity += bay.getCapacity(); } } return capacity; }
public double getInsulatedCargoCapacity() { double capacity = 0; for (Bay bay : entity.getTransportBays()) { if (bay instanceof InsulatedCargoBay) { capacity += bay.getCapacity(); } } return capacity; }
public double getLiquidCargoCapacity() { double capacity = 0; for (Bay bay : entity.getTransportBays()) { if (bay instanceof LiquidCargoBay) { capacity += bay.getCapacity(); } } return capacity; }
public double getLivestockCargoCapacity() { double capacity = 0; for (Bay bay : entity.getTransportBays()) { if (bay instanceof LivestockCargoBay) { capacity += bay.getCapacity(); } } return capacity; }
for (Bay bay : entity.getTransportBays()) { if (bay instanceof MechBay) { bayCount.merge(UnitType.MEK, (int) bay.getCapacity(), Integer::sum); } else if (bay instanceof ProtomechBay) { bayCount.merge(UnitType.PROTOMEK, (int) bay.getCapacity(), Integer::sum); } else if (bay instanceof HeavyVehicleBay) { bayCount.merge(UnitType.TANK, (int) bay.getCapacity(), Integer::sum); } else if (bay instanceof LightVehicleBay) { bayCount.merge(UnitType.VTOL, (int) bay.getCapacity(), Integer::sum); } else if (bay instanceof SuperHeavyVehicleBay) { bayCount.merge(UnitType.NAVAL, (int) bay.getCapacity(), Integer::sum); } else if (bay instanceof BattleArmorBay) { bayCount.merge(UnitType.BATTLE_ARMOR, (int) bay.getCapacity(), Integer::sum); } else if (bay instanceof InfantryBay) { bayCount.merge(UnitType.BATTLE_ARMOR, (int) bay.getCapacity(), Integer::sum); } else if (bay instanceof ASFBay) { bayCount.merge(UnitType.AERO, (int) bay.getCapacity(), Integer::sum); } else if (bay instanceof SmallCraftBay) { bayCount.merge(UnitType.SMALL_CRAFT, (int) bay.getCapacity(), Integer::sum);
public int getASFCapacity() { int bays = 0; for (Bay b : getEntity().getTransportBays()) { if (b instanceof ASFBay) { bays += b.getCapacity(); } } return bays; }
public int getMechCapacity() { int bays = 0; for (Bay b : getEntity().getTransportBays()) { if (b instanceof MechBay) { bays += b.getCapacity(); } } return bays; }
public int getBattleArmorCapacity() { int bays = 0; for (Bay b : getEntity().getTransportBays()) { if (b instanceof BattleArmorBay) { bays += b.getCapacity(); } } return bays; }
public int getProtomechCapacity() { int bays = 0; for (Bay b : getEntity().getTransportBays()) { if (b instanceof ProtomechBay) { bays += b.getCapacity(); } } return bays; }
public int getHeavyVehicleCapacity() { int bays = 0; for (Bay b : getEntity().getTransportBays()) { if (b instanceof HeavyVehicleBay) { bays += b.getCapacity(); } } return bays; }
public int getLightVehicleCapacity() { int bays = 0; for (Bay b : getEntity().getTransportBays()) { if (b instanceof LightVehicleBay) { bays += b.getCapacity(); } } return bays; }
public int getSmallCraftCapacity() { int bays = 0; for (Bay b : getEntity().getTransportBays()) { if (b instanceof SmallCraftBay) { bays += b.getCapacity(); } } return bays; }
private void updateBayCount(Jumpship jumpship) { for (Bay bay : jumpship.getTransportBays()) { if (bay instanceof ASFBay) { setFighterBayCount(getFighterBayCount() + (int) bay.getCapacity()); } else if (bay instanceof SmallCraftBay) { setSmallCraftBayCount(getSmallCraftBayCount() + (int) bay.getCapacity()); } } }
/** * Requiring the life support system to be changed just because the number of bay personnel changes * is a bit much. Instead we'll limit it to changes in crew size, measured by quarters. * @return true if the crew quarters capacity changed. */ private boolean crewSizeChanged() { int oldCrew = oldUnit.getEntity().getTransportBays() .stream().filter(b -> b.isQuarters()) .mapToInt(b -> (int) b.getCapacity()) .sum(); int newCrew = newEntity.getTransportBays() .stream().filter(b -> b.isQuarters()) .mapToInt(b -> (int) b.getCapacity()) .sum(); return oldCrew != newCrew; }
public static Map<Quarters, Integer> getQuartersByType(Aero aero) { EnumMap<TestAero.Quarters, Integer> sizes = new EnumMap<>(TestAero.Quarters.class); for (Quarters q : values()) { sizes.put(q, 0); } for (Bay bay : aero.getTransportBays()) { Quarters q = getQuartersForBay(bay); if (null != q) { sizes.merge(q, (int) bay.getCapacity(), Integer::sum); } } return sizes; } }
protected void addTransportBays(Entity entity) { final List<Map<String, Object>> bays = new ArrayList<>(); for (final Bay bay : entity.getTransportBays()) { if (bay.isQuarters()) { continue; } final BayData bayData = BayData.getBayType(bay); if (null != bayData) { final Map<String, Object> bayRow = new HashMap<>(); bayRow.put("name", bayData.getDisplayName()); if (bayData.isCargoBay()) { bayRow.put("size", bay.getCapacity() + Messages.getString("TROView.tons")); } else { bayRow.put("size", (int) bay.getCapacity()); } bayRow.put("doors", bay.getDoors()); bays.add(bayRow); } else { DefaultMmLogger.getInstance().warning(getClass(), "addBays()", "Could not determine bay type for " + bay.toString()); } } setModelData("bays", bays); }
private void updateBayCount(Dropship ds) { // ToDo Superheavy Bays. for (Bay bay : ds.getTransportBays()) { if (bay instanceof MechBay) { setMechBayCount(getMechBayCount() + (int)bay.getCapacity()); } else if (bay instanceof BattleArmorBay) { setBaBayCount(getBaBayCount() + (int)bay.getCapacity()); } else if (bay instanceof InfantryBay) { setInfantryBayCount(getInfantryBayCount() + (int) (bay.getCapacity() / ((InfantryBay) bay).getPlatoonType().getWeight())); } else if (bay instanceof LightVehicleBay) { setLightVeeBayCount(getLightVeeBayCount() + (int) bay.getCapacity()); } else if (bay instanceof HeavyVehicleBay) { setHeavyVeeBayCount(getHeavyVeeBayCount() + (int) bay.getCapacity()); } else if (bay instanceof ASFBay) { setFighterBayCount(getFighterBayCount() + (int) bay.getCapacity()); } else if (bay instanceof SmallCraftBay) { setSmallCraftBayCount(getSmallCraftBayCount() + (int) bay.getCapacity()); } } }
public int getInfantryCapacity() { int bays = 0; for (Bay b : getEntity().getTransportBays()) { if (b instanceof InfantryBay) { bays += b.getCapacity() / ((InfantryBay) b).getPlatoonType().getWeight(); } } return bays; }
Quarters q = Quarters.getQuartersForBay(bay); if (null != q) { quarters += bay.getCapacity();