public void NextPreset() { int idx = _presets.FindIndex(preset => preset.Equals(_current)); if (idx >= 0) { idx++; if (idx >= _presets.Count) { idx = 0; } } else { idx = 0; } TAWSPreset taws = _presets[idx]; warnApproachVelMin = taws.LandingSpeed; warnAltitudeMax = taws.MaxAltitude; warnApproachVelMax = taws.MaxSpeed; lateralInclusion = taws.LateralInclusion; landingTolerance = taws.LandingTolerance; presetString = taws.Title; }
public override bool Equals(object obj) { if (obj is TAWSPreset) { TAWSPreset rhs = (TAWSPreset)obj; if (LandingSpeed != rhs.LandingSpeed) { return(false); } if (MaxAltitude != rhs.MaxAltitude) { return(false); } if (MaxSpeed != rhs.MaxSpeed) { return(false); } if (LandingTolerance != rhs.LandingTolerance) { return(false); } if (LateralInclusion != rhs.LateralInclusion) { return(false); } return(true); } return(base.Equals(obj)); }
public void Update() { _current.LandingSpeed = warnApproachVelMin; _current.MaxAltitude = warnAltitudeMax; _current.MaxSpeed = warnApproachVelMax; _current.LandingTolerance = landingTolerance; _current.LateralInclusion = lateralInclusion; TAWSPreset taws = _presets.Find(preset => preset.Equals(_current)); if (taws == null) { presetString = "Custom"; } else { presetString = taws.Title; } CheckTerrainWarning(); }