// Suppress IDE0022:Use block body for methods -- short extension methods may be declared with expression body
#pragma warning disable IDE0022 

using System;

namespace Volpe.Cafe.EspressoUI.ModelCharts
{
    /// <summary>
    /// Provides extension methods for various enumerations defined within the <see cref="ModelCharts"/> namespace.
    /// </summary>
    [Serializable]
    static class EnumExtensions
    {
        #region < Enum ComplianceMetrics >

        /// <summary>
        /// Determines whether this <see cref="ComplianceMetrics"/> value contains the specified <see cref="ComplianceMetrics"/> value.
        /// </summary>
        /// <param name="metrics">The containing <see cref="ComplianceMetrics"/> value to test against.</param>
        /// <param name="value">The value to test.</param>
        /// <returns>true, if the specified value is fully contained within this <see cref="ComplianceMetrics"/>; false, otherwise.</returns>
        public static bool Contains(this ComplianceMetrics metrics, ComplianceMetrics value) => ((metrics & value) == value);

        /// <summary>Determines whether the specified <see cref="ComplianceMetrics"/> instance contains <see cref="ComplianceMetrics.CAFEValues"/>.</summary>
        public static bool HasCAFEValues(this ComplianceMetrics metrics) => (metrics.Contains(ComplianceMetrics.CAFEValues));
        /// <summary>Determines whether the specified <see cref="ComplianceMetrics"/> instance contains <see cref="ComplianceMetrics.CO2Values"/>.</summary>
        public static bool HasCO2Values(this ComplianceMetrics metrics) => (metrics.Contains(ComplianceMetrics.CO2Values));
        /// <summary>Determines whether the specified <see cref="ComplianceMetrics"/> instance contains <see cref="ComplianceMetrics.ComplianceCosts"/>.</summary>
        public static bool HasComplianceCosts(this ComplianceMetrics metrics) => (metrics.Contains(ComplianceMetrics.ComplianceCosts));
        /// <summary>Determines whether the specified <see cref="ComplianceMetrics"/> instance contains <see cref="ComplianceMetrics.EffectsCosts"/>.</summary>
        public static bool HasEffectsCosts(this ComplianceMetrics metrics) => (metrics.Contains(ComplianceMetrics.EffectsCosts));

        #endregion
    }
}
