Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ObjectSequenceMany.cs
Go to the documentation of this file.
2
3internal struct ObjectSequenceMany : IEquatable<ObjectSequenceMany>, IObjectSequence
4{
5 private readonly object[] _values;
6
7 public ObjectSequenceMany(object[] values)
8 {
10 }
11
13 {
14 if (_values.Length != other._values.Length)
15 {
16 return false;
17 }
18 for (int i = 0; i < _values.Length; i++)
19 {
20 object obj = _values[i];
21 object obj2 = other._values[i];
22 if (obj == null)
23 {
24 if (obj2 != null)
25 {
26 return false;
27 }
28 }
29 else if (!obj.Equals(obj2))
30 {
31 return false;
32 }
33 }
34 return true;
35 }
36
37 public override bool Equals(object obj)
38 {
40 {
41 return Equals(other);
42 }
43 return false;
44 }
45
47 {
48 return _values.AsSpan();
49 }
50
51 public override int GetHashCode()
52 {
53 HashCode hashCode = default(HashCode);
54 for (int i = 0; i < _values.Length; i++)
55 {
56 hashCode.Add(_values[i]);
57 }
58 return hashCode.ToHashCode();
59 }
60}
void Add(int value)
Definition HashCode.cs:239