internal AircraftConfiguration CreateIncremental(AircraftConfiguration cfg) { EnsurePopulated(); cfg.EnsurePopulated(); AircraftConfiguration inc = new AircraftConfiguration { Lights = Lights.CreateIncremental(cfg.Lights), Engines = Engines.CreateIncremental(cfg.Engines) }; if (cfg.GearDown != GearDown) { inc.GearDown = cfg.GearDown; } if (cfg.FlapsPercent != FlapsPercent) { inc.FlapsPercent = cfg.FlapsPercent; } if (cfg.SpoilersDeployed != SpoilersDeployed) { inc.SpoilersDeployed = cfg.SpoilersDeployed; } if (cfg.OnGround != OnGround) { inc.OnGround = cfg.OnGround; } return(inc); }
internal void ApplyIncremental(AircraftConfiguration inc) { if (inc.Lights != null) { Lights.ApplyIncremental(inc.Lights); } if (inc.Engines != null) { Engines.ApplyIncremental(inc.Engines); } if (inc.GearDown.HasValue) { GearDown = inc.GearDown.Value; } if (inc.FlapsPercent.HasValue) { FlapsPercent = inc.FlapsPercent.Value; } if (inc.SpoilersDeployed.HasValue) { SpoilersDeployed = inc.SpoilersDeployed.Value; } if (inc.OnGround.HasValue) { OnGround = inc.OnGround.Value; } }
internal static AircraftConfiguration FromUserAircraftData(UserAircraftData uad) { AircraftConfiguration cfg = new AircraftConfiguration { Lights = AircraftConfigurationLights.FromUserAircraftData(uad), Engines = AircraftConfigurationEngines.FromUserAircraftData(uad), GearDown = uad.GearDown, FlapsPercent = RoundUpToNearest5(uad.FlapsPercentage), SpoilersDeployed = uad.SpeedBrakeDeployed, OnGround = uad.OnGround }; return(cfg); }
internal AircraftConfiguration Clone() { AircraftConfiguration clone = new AircraftConfiguration { IsFullData = IsFullData }; if (Lights != null) { clone.Lights = Lights.Clone(); } if (Engines != null) { clone.Engines = Engines.Clone(); } clone.GearDown = GearDown; clone.FlapsPercent = FlapsPercent; clone.SpoilersDeployed = SpoilersDeployed; clone.OnGround = OnGround; return(clone); }