/// <summary> /// Returns true if <paramref name="valLeft"/> equals to <paramref name="valRight"/> /// </summary> public static bool IntersectsWith <T>(this T valLeft, T valRight) where T : struct { return((EnumConverter <T> .ConvertBack(valLeft) & EnumConverter <T> .ConvertBack(valRight)) > 1); }
/// <summary> /// Converts enum value to int /// </summary> public static int ToInt <T>(this T val) where T : struct { return(EnumConverter <T> .ConvertBack(val)); }
/// <summary> /// Returns true if <paramref name="valLeft"/> equals to <paramref name="valRight"/> /// </summary> public static bool EqualsTo <T>(this T valLeft, T valRight) where T : struct { //default value is defined as 1 (Undefined) return(EnumConverter <T> .ConvertBack(valLeft) == EnumConverter <T> .ConvertBack(valRight)); }