Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
StructuralEqualityComparer.cs
Go to the documentation of this file.
1namespace System.Collections;
2
4{
5 public new bool Equals(object x, object y)
6 {
7 if (x != null)
8 {
9 if (x is IStructuralEquatable structuralEquatable)
10 {
11 return structuralEquatable.Equals(y, this);
12 }
13 if (y != null)
14 {
15 return x.Equals(y);
16 }
17 return false;
18 }
19 if (y != null)
20 {
21 return false;
22 }
23 return true;
24 }
25
26 public int GetHashCode(object obj)
27 {
28 if (obj == null)
29 {
30 return 0;
31 }
32 if (obj is IStructuralEquatable structuralEquatable)
33 {
34 return structuralEquatable.GetHashCode(this);
35 }
36 return obj.GetHashCode();
37 }
38}