Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryCreateEnumComparer()

static object System.Collections.Generic.ComparerHelpers.TryCreateEnumComparer ( RuntimeType enumType)
inlinestaticprivate

Definition at line 37 of file ComparerHelpers.cs.

38 {
39 TypeCode typeCode = Type.GetTypeCode(Enum.GetUnderlyingType(enumType));
40 if ((uint)(typeCode - 5) <= 7u)
41 {
42 return RuntimeTypeHandle.CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(EnumComparer<>), enumType);
43 }
44 return null;
45 }

References System.RuntimeTypeHandle.CreateInstanceForAnotherGenericParameter(), System.Type.GetTypeCode(), and System.Enum.GetUnderlyingType().

Referenced by System.Collections.Generic.ComparerHelpers.CreateDefaultComparer().