namespace ZB.MOM.WW.LmxProxy.Host.Domain
{
    /// <summary>
    ///     Extension methods for the <see cref="Quality"/> enum.
    /// </summary>
    public static class QualityExtensions
    {
        /// <summary>Returns true if quality is in the Good family (byte >= 192).</summary>
        public static bool IsGood(this Quality q) => (byte)q >= 192;

        /// <summary>Returns true if quality is in the Uncertain family (byte 64-127).</summary>
        public static bool IsUncertain(this Quality q) => (byte)q >= 64 && (byte)q < 128;

        /// <summary>Returns true if quality is in the Bad family (byte < 64).</summary>
        public static bool IsBad(this Quality q) => (byte)q < 64;
    }
}
