Firstborn/Library/PackageCache/com.unity.collab-proxy@1.17.7/Editor/PlasticSCM/EnumExtensions.cs

21 lines
571 B
C#
Raw Normal View History

2023-03-28 13:24:16 -04:00
using System;
namespace Unity.PlasticSCM.Editor
{
internal static class EnumExtensions
{
internal static bool HasFlag(this Enum variable, Enum value)
{
if (variable.GetType() != value.GetType())
throw new ArgumentException(
"The checked flag is not from the same type as the checked variable.");
Convert.ToUInt64(value);
ulong num = Convert.ToUInt64(value);
ulong num2 = Convert.ToUInt64(variable);
return (num2 & num) == num;
}
}
}