using System.Collections.Generic; namespace Core { public static class Extensions { private const float Epsilon = 0.0001f; public static bool IsNullOrEmpty(this T[] inArray) => inArray == null || inArray.Length == 0; public static bool IsNullOrEmpty(this IList inList) => inList == null || inList.Count == 0; public static bool IsNullOrEmpty(this Queue inList) => inList == null || inList.Count == 0; public static bool AlmostZero(this float inFloat) => inFloat < (Epsilon * Epsilon); public static bool IsNull(this object inObject) => ReferenceEquals(inObject, null); /*public static IEnumerable GetFlags(this T inputEnum) where T : Enum { foreach(Enum value in Enum.GetValues(typeof(T))) if (inputEnum.HasFlag(value)) yield return (T) value; }*/ // public static IEnumerable GetFlags(this T inputEnum) where T : Enum => // Enum.GetValues(typeof(T)).Cast().Where(type => inputEnum.HasFlag(type)); } }