public TestAero(Aero a, TestEntityOption option, String fs) { super(option, a.getEngine(), getArmor(a), getStructure(a)); aero = a; fileString = fs; }
protected int calculateWalk() { if (!hasEngine()) { return 0; } if (isPrimitive()) { double rating = getEngine().getRating(); rating /= 1.2; if ((rating % 5) != 0) { return (int) (((rating - (rating % 5)) + 5) / (int) weight) + 2; } return (int) (rating / (int) weight) + 2; } return (getEngine().getRating() / (int) weight) + 2; }
@Override public void setEngine(Engine e) { super.setEngine(e); if (hasEngine() && getEngine().engineValid) { setOriginalWalkMP(calculateWalk()); } }
public static int weightFreeHeatSinks(Aero aero) { if (aero.hasETypeFlag(Entity.ETYPE_SMALL_CRAFT)) { return TestSmallCraft.weightFreeHeatSinks((SmallCraft) aero); } else if (aero.hasETypeFlag(Entity.ETYPE_JUMPSHIP)) { return TestAdvancedAerospace.weightFreeHeatSinks((Jumpship) aero); } else if (aero.hasEngine()) { return aero.getEngine().getWeightFreeEngineHeatSinks(); } else { return 0; } }
/** * Computes and returns the maximum number of turns the given unit could * fly at safe thrust given its fuel payload. Aerospace fighters consume * 1 fuel point per thrust point spent up the the maximum safe thrust, * whereas conventional fighters with turbine engines consume 0.5 fuel * points per thrust point spent up to the maximum safe thrust. * See Strategic Operations pg 34. * * @param aero * @return */ public static float calculateMaxTurnsAtSafe(Aero aero){ int fuelPoints = aero.getFuel(); float fuelPerTurn; if (aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER) && aero.hasEngine() && (aero.getEngine().getEngineType() == Engine.COMBUSTION_ENGINE)) { fuelPerTurn = aero.getWalkMP() * 0.5f; } else if (aero.getWalkMP() == 0) { fuelPerTurn = 0.2f; } else { fuelPerTurn = aero.getWalkMP(); } return fuelPoints/fuelPerTurn; }
@Override public double getWeightPowerAmp() { // Conventional Fighters with ICE engines may need a power amp if ((aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) && aero.hasEngine() && (aero.getEngine().getEngineType() == Engine.COMBUSTION_ENGINE)) { double weight = 0; for (Mounted m : aero.getWeaponList()) { WeaponType wt = (WeaponType) m.getType(); if (wt.hasFlag(WeaponType.F_ENERGY) && !(wt instanceof CLChemicalLaserWeapon) && !(wt instanceof VehicleFlamerWeapon)) { weight += wt.getTonnage(aero); } Mounted linkedBy = m.getLinkedBy(); if ((linkedBy != null) && (linkedBy.getType() instanceof MiscType) && linkedBy.getType().hasFlag(MiscType.F_PPC_CAPACITOR)){ weight += ((MiscType)linkedBy.getType()).getTonnage(aero); } } // Power amp weighs: // energy weapon tonnage * 0.1 rounded to nearest half ton return Math.ceil(0.1 * weight*2) / 2.0; } return 0; }
setModelData("isConventional", aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)); final TestAero testAero = new TestAero(aero, verifier.aeroOption, null); setModelData("engineName", stripNotes(aero.getEngine().getEngineName())); setModelData("engineMass", NumberFormat.getInstance().format(testAero.getWeightEngine())); setModelData("safeThrust", aero.getWalkMP());
fuelPerTurn = aero.getWalkMP() * 0.5f; if(aero.hasEngine()) { if(aero.getEngine().isFusion()) { fuelPerTurn += (aero.getRunMP()-aero.getWalkMP()) * 2; } else {