Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ActivityLink.cs
Go to the documentation of this file.
3
4namespace System.Diagnostics;
5
6public readonly struct ActivityLink : IEquatable<ActivityLink>
7{
8 public ActivityContext Context { get; }
9
11
13 {
14 Context = context;
15 Tags = tags;
16 }
17
18 public override bool Equals([NotNullWhen(true)] object? obj)
19 {
21 {
22 return Equals(value);
23 }
24 return false;
25 }
26
28 {
29 if (Context == value.Context)
30 {
31 return value.Tags == Tags;
32 }
33 return false;
34 }
35
36 public static bool operator ==(ActivityLink left, ActivityLink right)
37 {
38 return left.Equals(right);
39 }
40
41 public static bool operator !=(ActivityLink left, ActivityLink right)
42 {
43 return !left.Equals(right);
44 }
45
46 public override int GetHashCode()
47 {
48 HashCode hashCode = default(HashCode);
49 hashCode.Add(Context);
50 if (Tags != null)
51 {
52 foreach (KeyValuePair<string, object> tag in Tags)
53 {
54 hashCode.Add(tag.Key);
55 hashCode.Add(tag.Value);
56 }
57 }
58 return hashCode.ToHashCode();
59 }
60}
void Add(int value)
Definition HashCode.cs:239