public void estimateEditorPerformance() { bool attached_reactor_upgraded = false; FloatCurve atmospherecurve = new FloatCurve(); float thrust = 0; if (myAttachedReactor != null) { if (myAttachedReactor is IUpgradeableModule) { IUpgradeableModule upmod = myAttachedReactor as IUpgradeableModule; if (upmod.HasTechsRequiredToUpgrade()) { attached_reactor_upgraded = true; } } maxISP = (float)(Math.Sqrt((double)myAttachedReactor.CoreTemperature) * isp_temp_rat * ispMultiplier); minISP = maxISP * 0.4f; atmospherecurve.Add(0, maxISP, 0, 0); atmospherecurve.Add(1, minISP, 0, 0); thrust = (float)(2 * myAttachedReactor.MaximumPower * 1000 / g0 / maxISP); myAttachedEngine.maxThrust = thrust; myAttachedEngine.atmosphereCurve = atmospherecurve; } else { atmospherecurve.Add(0, 0.00001f, 0, 0); myAttachedEngine.maxThrust = thrust; myAttachedEngine.atmosphereCurve = atmospherecurve; } }
public static bool HasTechsRequiredToUpgrade(this IUpgradeableModule upg_module) { return(PluginHelper.upgradeAvailable(upg_module.UpgradeTechnology)); }