Example #1
0
        /// <summary>
        /// Is this a lighter-than-air
        /// </summary>
        /// <param name="ccid">The ID</param>
        /// <returns>True for lighter-than-air</returns>
        public static bool IsLighterThanAir(CatClassID ccid)
        {
            switch (ccid)
            {
            default: return(false);

            case CatClassID.Airship:
            case CatClassID.GasBalloon:
            case CatClassID.HotAirBalloon:
                return(true);
            }
        }
Example #2
0
        /// <summary>
        /// Returns the category/class for a given ID
        /// </summary>
        /// <param name="id">The requested ID</param>
        /// <returns>The specified category/class; throws an exception if not found</returns>
        public static CategoryClass CategoryClassFromID(CatClassID id)
        {
            IEnumerable <CategoryClass> rgCatClass = CategoryClasses();

            foreach (CategoryClass cc in rgCatClass)
            {
                if (cc.IdCatClass == id)
                {
                    return(cc);
                }
            }
            throw new InvalidDataException("CategoryClassFromID: category/class with ID " + id.ToString() + " does not exist.");
        }
Example #3
0
        /// <summary>
        /// Does this have an engine?
        /// </summary>
        /// <param name="cc"></param>
        /// <returns></returns>
        public static Boolean HasEngine(CatClassID cc)
        {
            switch (cc)
            {
            case CatClassID.Glider:
            case CatClassID.GasBalloon:
            case CatClassID.HotAirBalloon:
            case CatClassID.Airship:
                return(false);

            default:
                return(true);
            }
        }
Example #4
0
        /// <summary>
        /// Is this an airplane?
        /// </summary>
        /// <param name="ccid">ID of the category/class</param>
        /// <returns>True if it is ASEL/ASES/AMEL/AMES</returns>
        public static bool IsAirplane(CatClassID ccid)
        {
            switch (ccid)
            {
            case CategoryClass.CatClassID.ASEL:
            case CategoryClass.CatClassID.ASES:
            case CategoryClass.CatClassID.AMEL:
            case CategoryClass.CatClassID.AMES:
                return(true);

            default:
                return(false);
            }
        }
Example #5
0
        /// <summary>
        /// Is this a sea or a land vessel?
        /// </summary>
        /// <param name="cc">The CatClasses enumerator</param>
        /// <returns>True for sea</returns>
        public static Boolean IsSeaClass(CatClassID cc)
        {
            switch (cc)
            {
            case CatClassID.AMES:
            case CatClassID.ASES:
            case CatClassID.PoweredParachuteSea:
            case CatClassID.WeightShiftControlSea:
                return(true);

            default:
                return(false);
            }
        }
Example #6
0
        /// <summary>
        /// Is this a powered aircraft?
        /// </summary>
        /// <param name="ccid">ID of the category/class</param>
        /// <returns>True if it is powered</returns>
        public static bool IsPowered(CatClassID ccid)
        {
            switch (ccid)
            {
            case CatClassID.AMEL:
            case CatClassID.AMES:
            case CatClassID.ASEL:
            case CatClassID.ASES:
            case CatClassID.Gyroplane:
            case CatClassID.Helicopter:
            case CatClassID.PoweredLift:
            case CatClassID.PoweredParachuteLand:
            case CatClassID.PoweredParachuteSea:
                return(true);

            default:
                return(false);
            }
        }
Example #7
0
 /// <summary>
 /// Is this a manned aircraft (i.e., is the pilot on board?) - 61.57 really only applies to manned categories.
 /// </summary>
 /// <param name="cc">ID of the category/class</param>
 /// <returns>True if it is manned</returns>
 public static Boolean IsManned(CatClassID cc)
 {
     return(cc != CatClassID.UnmannedAerialSystem);
 }
Example #8
0
 /// <summary>
 /// Is this heavier-than-air?
 /// </summary>
 /// <param name="ccid">The ID</param>
 /// <returns>True for not-lighter-than-air</returns>
 public static bool IsHeavierThanAir(CatClassID ccid)
 {
     return(!IsLighterThanAir(ccid));
 }