public void ChangeMinNeededRunwaySize(string fixedwingId, double minNeededRunwaySize) { Fixedwing fixedwing = fixedwingsAccess.GetById(fixedwingId); if (fixedwing.AirportId != string.Empty) { Airport airport = airportsAccess.GetById(fixedwing.AirportId); if (minNeededRunwaySize > airport.RunwaySize) { throw new Exception("Min needed runway size exceeds current airport runway size."); } } fixedwingsAccess.ChangeMinNeededRunwaySize(fixedwingId, minNeededRunwaySize); }
public void ParkFixedwing(string airportId, string fixedwingId) { Airport airport = airportsAccess.GetById(airportId); Fixedwing fixedwing = fixedwingsAccess.GetById(fixedwingId); if (fixedwing.AirportId == string.Empty) { if (fixedwing.MinNeededRunwaySize < airport.RunwaySize) { airportsAccess.ParkFixedwing(airportId, fixedwingId); fixedwingsAccess.Park(fixedwingId, airportId); } else { throw new Exception("Min needed runway size exceeds airport runway size."); } } else { throw new Exception($"Fixedwing {fixedwingId} already parks in airport {fixedwing.AirportId}."); } }
public string SelectedFixedwing(string fixedwingId) { Fixedwing fixedwing = fixedwingsAccess.GetById(fixedwingId); return(fixedwing.FullInfo()); }