Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EnumEqualityComparer.cs
Go to the documentation of this file.
4
6
8[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
10{
11 [MethodImpl(MethodImplOptions.AggressiveInlining)]
12 public override bool Equals(T x, T y)
13 {
14 return RuntimeHelpers.EnumEquals(x, y);
15 }
16
17 internal override int IndexOf(T[] array, T value, int startIndex, int count)
18 {
19 int num = startIndex + count;
20 for (int i = startIndex; i < num; i++)
21 {
22 if (RuntimeHelpers.EnumEquals(array[i], value))
23 {
24 return i;
25 }
26 }
27 return -1;
28 }
29
30 internal override int LastIndexOf(T[] array, T value, int startIndex, int count)
31 {
32 int num = startIndex - count + 1;
33 for (int num2 = startIndex; num2 >= num; num2--)
34 {
35 if (RuntimeHelpers.EnumEquals(array[num2], value))
36 {
37 return num2;
38 }
39 }
40 return -1;
41 }
42
44 {
45 }
46
50
52 {
54 {
56 }
57 }
58
59 [MethodImpl(MethodImplOptions.AggressiveInlining)]
60 public override int GetHashCode(T obj)
61 {
62 return obj.GetHashCode();
63 }
64
65 public override bool Equals([NotNullWhen(true)] object? obj)
66 {
67 if (obj != null)
68 {
69 return GetType() == obj.GetType();
70 }
71 return false;
72 }
73
74 public override int GetHashCode()
75 {
76 return GetType().GetHashCode();
77 }
78}
void GetObjectData(SerializationInfo info, StreamingContext context)
override int LastIndexOf(T[] array, T value, int startIndex, int count)
override bool Equals([NotNullWhen(true)] object? obj)
EnumEqualityComparer(SerializationInfo information, StreamingContext context)
override int IndexOf(T[] array, T value, int startIndex, int count)
static Type GetUnderlyingType(Type enumType)
Definition Enum.cs:309
static TypeCode GetTypeCode(Type? type)
Definition Type.cs:919
TypeCode
Definition TypeCode.cs:4