public double getWeightQuarters() { double quartersWeight = 0; for (Bay bay : getEntity().getTransportBays()) { if (bay.isQuarters()) { quartersWeight += bay.getWeight(); } } return quartersWeight; }
public String printWeightQuarters() { double weight = 0.0; for (Bay bay : aero.getTransportBays()) { if (bay.isQuarters()) { weight += bay.getWeight(); } } if (weight > 0) { return StringUtil.makeLength("Crew quarters: ", getPrintSize() - 5) + weight + "\n"; } return ""; }
@Test public void testCargoBayMultiplier() { final double size = 2.0; Bay cargoBay = BayData.CARGO.newBay(size, 0); assertEquals(cargoBay.getWeight(), BayData.CARGO.getWeight() * size, 0.01); }
@Test public void testRefrigeratedCargoBayMultiplier() { final double size = 2.0; Bay cargoBay = BayData.REFRIGERATED_CARGO.newBay(size, 0); assertEquals(cargoBay.getWeight(), BayData.REFRIGERATED_CARGO.getWeight() * size, 0.01); }
@Test public void testInsulatedCargoBayMultiplier() { final double size = 2.0; Bay cargoBay = BayData.INSULATED_CARGO.newBay(size, 0); assertEquals(cargoBay.getWeight(), BayData.INSULATED_CARGO.getWeight() * size, 0.01); }
@Test public void testLiquidCargoBayMultiplier() { final double size = 2.0; Bay cargoBay = BayData.LIQUID_CARGO.newBay(size, 0); assertEquals(cargoBay.getWeight(), BayData.LIQUID_CARGO.getWeight() * size, 0.01); }
@Test public void testLivestockCargoBayMultiplier() { final double size = 2.0; Bay cargoBay = BayData.LIVESTOCK_CARGO.newBay(size, 0); assertEquals(cargoBay.getWeight(), BayData.LIVESTOCK_CARGO.getWeight() * size, 0.01); }
public double getWeightCarryingSpace() { double carryingSpace = getEntity().getTroopCarryingSpace(); double cargoWeight = 0; Ceil rounding = Ceil.HALFTON; if (getEntity().isSupportVehicle() && (getEntity().getWeight() < 5.0)) { rounding = Ceil.KILO; } for (Bay bay : getEntity().getTransportBays()) { if (!bay.isQuarters()) { cargoWeight += bay.getWeight(); } } return ceil(carryingSpace + cargoWeight, rounding); }
public String printWeightCarryingSpace() { String carryingSpace = ""; if (getEntity().getTroopCarryingSpace() != 0) { carryingSpace = StringUtil.makeLength("Carrying Capacity:", getPrintSize() - 5) + TestEntity.makeWeightString(getEntity() .getTroopCarryingSpace()) + "\n"; } String cargoWeightString = ""; double cargoWeight = 0; for (Bay bay : getEntity().getTransportBays()) { cargoWeight += bay.getWeight(); } if (cargoWeight > 0) { cargoWeightString = StringUtil.makeLength("Cargo Weight:", getPrintSize() - 5) + TestEntity.makeWeightString(cargoWeight) + "\n"; } return carryingSpace + cargoWeightString; }