/// <summary> /// Determines if the category/class matches the rating being sought /// </summary> /// <param name="ccid">The category/class</param> /// <returns>True if it applies to the rating</returns> protected bool CatClassMatchesRatingSought(CategoryClass.CatClassID ccid) { switch (RatingSought) { case RatingType.PPLAirplaneMulti: case RatingType.CommercialAMES: case RatingType.CommercialAMEL: case RatingType.PPLPart141MultiEngine: return(ccid == CategoryClass.CatClassID.AMEL || ccid == CategoryClass.CatClassID.AMES); case RatingType.PPLAirplaneSingle: case RatingType.CommercialASEL: case RatingType.CommercialASES: case RatingType.PPLPart141SingleEngine: return(ccid == CategoryClass.CatClassID.ASEL || ccid == CategoryClass.CatClassID.ASES); case RatingType.PPLHelicopter: case RatingType.InstrumentHelicopter: case RatingType.CommercialHelicopter: case RatingType.PPLPart141Helicopter: case RatingType.SAPPLHelicopter: case RatingType.SAPPLNightHelicopter: case RatingType.CAPPLHelicopter: case RatingType.CANightHelicopter: case RatingType.PPLJARHelicopter: return(ccid == CategoryClass.CatClassID.Helicopter); case RatingType.InstrumentAirplane: case RatingType.SAPPLAirplane: case RatingType.SAPPLNightAirplane: case RatingType.CAPPLAirplaneLand: case RatingType.CAPPLAirplaneSea: case RatingType.CANightAirplane: case RatingType.PPLJARAirplane: return(CategoryClass.IsAirplane(ccid)); case RatingType.InstrumentPoweredLift: return(ccid == CategoryClass.CatClassID.PoweredLift); case RatingType.PPLPart141Gyroplane: case RatingType.PPLGyroplane: return(ccid == CategoryClass.CatClassID.Gyroplane); case RatingType.PPLPoweredLift: return(ccid == CategoryClass.CatClassID.PoweredLift); case RatingType.PPLAirship: return(ccid == CategoryClass.CatClassID.Airship); case RatingType.PPLGlider: case RatingType.PPLPart141Glider: case RatingType.CommercialGlider: return(ccid == CategoryClass.CatClassID.Glider); case RatingType.PPLBalloon: return(CategoryClass.IsBalloon(ccid)); case RatingType.CommercialBalloonGas: return(ccid == CategoryClass.CatClassID.GasBalloon); case RatingType.CommercialBalloonHot: return(ccid == CategoryClass.CatClassID.HotAirBalloon); case RatingType.PPLPoweredParachute: return(ccid == CategoryClass.CatClassID.PoweredParachuteLand || ccid == CategoryClass.CatClassID.PoweredParachuteSea); case RatingType.PPLWeightShift: return(ccid == CategoryClass.CatClassID.WeightShiftControlLand || ccid == CategoryClass.CatClassID.WeightShiftControlSea); default: throw new NotImplementedException(); } }