public static string RequirementText(string requirement) { var parts = Lib.Tokenize(requirement, ':'); var condition = parts[0]; string value = string.Empty; if (parts.Count > 1) { value = parts[1]; } switch (condition) { case "OrbitMinInclination": return(Lib.BuildString("Min. inclination ", value, "°")); case "OrbitMaxInclination": return(Lib.BuildString("Max. inclination ", value, "°")); case "OrbitMinEccentricity": return(Lib.BuildString("Min. eccentricity ", value)); case "OrbitMaxEccentricity": return(Lib.BuildString("Max. eccentricity ", value)); case "OrbitMinArgOfPeriapsis": return(Lib.BuildString("Min. argument of Pe ", value)); case "OrbitMaxArgOfPeriapsis": return(Lib.BuildString("Max. argument of Pe ", value)); case "AltitudeMin": return(Lib.BuildString("Min. altitude ", Lib.HumanReadableRange(Double.Parse(value)))); case "AltitudeMax": var v = Double.Parse(value); if (v >= 0) { return(Lib.BuildString("Max. altitude ", Lib.HumanReadableRange(v))); } return(Lib.BuildString("Min. depth ", Lib.HumanReadableRange(-v))); case "RadiationMin": return(Lib.BuildString("Min. radiation ", Lib.HumanReadableRadiation(Double.Parse(value)))); case "RadiationMax": return(Lib.BuildString("Max. radiation ", Lib.HumanReadableRadiation(Double.Parse(value)))); case "Body": return(PrettyBodyText(value)); case "TemperatureMin": return(Lib.BuildString("Min. temperature ", Lib.HumanReadableTemp(Double.Parse(value)))); case "TemperatureMax": return(Lib.BuildString("Max. temperature ", Lib.HumanReadableTemp(Double.Parse(value)))); case "CrewMin": return(Lib.BuildString("Min. crew ", value)); case "CrewMax": return(Lib.BuildString("Max. crew ", value)); case "CrewCapacityMin": return(Lib.BuildString("Min. crew capacity ", value)); case "CrewCapacityMax": return(Lib.BuildString("Max. crew capacity ", value)); case "VolumePerCrewMin": return(Lib.BuildString("Min. vol./crew ", Lib.HumanReadableVolume(double.Parse(value)))); case "VolumePerCrewMax": return(Lib.BuildString("Max. vol./crew ", Lib.HumanReadableVolume(double.Parse(value)))); case "MaxAsteroidDistance": return(Lib.BuildString("Max. asteroid distance ", Lib.HumanReadableRange(double.Parse(value)))); case "SunAngleMin": return(Lib.BuildString("Min. sun angle ", Lib.HumanReadableAngle(double.Parse(value)))); case "SunAngleMax": return(Lib.BuildString("Max. sun angle ", Lib.HumanReadableAngle(double.Parse(value)))); case "AtmosphereBody": return("Body with atmosphere"); case "AtmosphereAltMin": return(Lib.BuildString("Min. atmosphere altitude ", value)); case "AtmosphereAltMax": return(Lib.BuildString("Max. atmosphere altitude ", value)); case "SurfaceSpeedMin": return(Lib.BuildString("Min. surface speed ", Lib.HumanReadableSpeed(double.Parse(value)))); case "SurfaceSpeedMax": return(Lib.BuildString("Max. surface speed ", Lib.HumanReadableSpeed(double.Parse(value)))); case "VerticalSpeedMin": return(Lib.BuildString("Min. vertical speed ", Lib.HumanReadableSpeed(double.Parse(value)))); case "VerticalSpeedMax": return(Lib.BuildString("Max. vertical speed ", Lib.HumanReadableSpeed(double.Parse(value)))); case "SpeedMin": return(Lib.BuildString("Min. speed ", Lib.HumanReadableSpeed(double.Parse(value)))); case "SpeedMax": return(Lib.BuildString("Max. speed ", Lib.HumanReadableSpeed(double.Parse(value)))); case "DynamicPressureMin": return(Lib.BuildString("Min. dynamic pressure ", Lib.HumanReadablePressure(double.Parse(value)))); case "DynamicPressureMax": return(Lib.BuildString("Max. dynamic pressure ", Lib.HumanReadablePressure(double.Parse(value)))); case "StaticPressureMin": return(Lib.BuildString("Min. pressure ", Lib.HumanReadablePressure(double.Parse(value)))); case "StaticPressureMax": return(Lib.BuildString("Max. pressure ", Lib.HumanReadablePressure(double.Parse(value)))); case "AtmDensityMin": return(Lib.BuildString("Min. atm. density ", Lib.HumanReadablePressure(double.Parse(value)))); case "AtmDensityMax": return(Lib.BuildString("Max. atm. density ", Lib.HumanReadablePressure(double.Parse(value)))); case "AltAboveGroundMin": return(Lib.BuildString("Min. ground altitude ", Lib.HumanReadableRange(double.Parse(value)))); case "AltAboveGroundMax": return(Lib.BuildString("Max. ground altitude ", Lib.HumanReadableRange(double.Parse(value)))); case "MissionControlLevelMin": return(Lib.BuildString(ScenarioUpgradeableFacilities.GetFacilityName(SpaceCenterFacility.MissionControl), " level ", value)); case "MissionControlLevelMax": return(Lib.BuildString(ScenarioUpgradeableFacilities.GetFacilityName(SpaceCenterFacility.MissionControl), " max. level ", value)); case "AdministrationLevelMin": return(Lib.BuildString(ScenarioUpgradeableFacilities.GetFacilityName(SpaceCenterFacility.Administration), " level ", value)); case "AdministrationLevelMax": return(Lib.BuildString(ScenarioUpgradeableFacilities.GetFacilityName(SpaceCenterFacility.Administration), " max. level ", value)); case "TrackingStationLevelMin": return(Lib.BuildString(ScenarioUpgradeableFacilities.GetFacilityName(SpaceCenterFacility.TrackingStation), " level ", value)); case "TrackingStationLevelMax": return(Lib.BuildString(ScenarioUpgradeableFacilities.GetFacilityName(SpaceCenterFacility.TrackingStation), " max. level ", value)); case "AstronautComplexLevelMin": return(Lib.BuildString(ScenarioUpgradeableFacilities.GetFacilityName(SpaceCenterFacility.AstronautComplex), " level ", value)); case "AstronautComplexLevelMax": return(Lib.BuildString(ScenarioUpgradeableFacilities.GetFacilityName(SpaceCenterFacility.AstronautComplex), " max. level ", value)); case "Part": return(Lib.BuildString("Needs part ", value)); case "Module": return(Lib.BuildString("Needs module ", value)); default: return(Lib.SpacesOnCaps(condition)); } }