diff --git a/CHANGELOG.md b/CHANGELOG.md index 840d75c..46f9f7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Added MathUtils methods for converting to and from percentages + - Added enum extensions for finding the inclusion and exclusion of enum flags ## [10.2.0] - 2019-12-04 ### Added diff --git a/ICD.Common.Utils/Extensions/EnumExtensions.cs b/ICD.Common.Utils/Extensions/EnumExtensions.cs index 41604cc..121321b 100644 --- a/ICD.Common.Utils/Extensions/EnumExtensions.cs +++ b/ICD.Common.Utils/Extensions/EnumExtensions.cs @@ -31,6 +31,34 @@ namespace ICD.Common.Utils.Extensions return EnumUtils.HasFlags(extends, values); } + /// + /// Returns these enum flags, excluding the other enum flags. + /// + /// + /// + /// + /// + [PublicAPI] + public static T ExcludeFlags(this T extends, T other) + where T : struct, IConvertible + { + return EnumUtils.ExcludeFlags(extends, other); + } + + /// + /// Returns these enum flags, including the other enum flags. + /// + /// + /// + /// + /// + [PublicAPI] + public static T IncludeFlags(this T extends, T other) + where T : struct, IConvertible + { + return EnumUtils.IncludeFlags(extends, other); + } + /// /// Returns the enum value as a ///