Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DataObjectMethodAttribute.cs
Go to the documentation of this file.
2
4
5[AttributeUsage(AttributeTargets.Method)]
7{
8 public bool IsDefault { get; }
9
11
13 : this(methodType, isDefault: false)
14 {
15 }
16
17 public DataObjectMethodAttribute(DataObjectMethodType methodType, bool isDefault)
18 {
19 MethodType = methodType;
20 IsDefault = isDefault;
21 }
22
23 public override bool Equals([NotNullWhen(true)] object? obj)
24 {
25 if (obj == this)
26 {
27 return true;
28 }
29 if (obj is DataObjectMethodAttribute dataObjectMethodAttribute && dataObjectMethodAttribute.MethodType == MethodType)
30 {
31 return dataObjectMethodAttribute.IsDefault == IsDefault;
32 }
33 return false;
34 }
35
36 public override int GetHashCode()
37 {
38 return ((int)MethodType).GetHashCode() ^ IsDefault.GetHashCode();
39 }
40
41 public override bool Match([NotNullWhen(true)] object? obj)
42 {
43 if (obj == this)
44 {
45 return true;
46 }
47 if (obj is DataObjectMethodAttribute dataObjectMethodAttribute)
48 {
49 return dataObjectMethodAttribute.MethodType == MethodType;
50 }
51 return false;
52 }
53}
override bool Equals([NotNullWhen(true)] object? obj)
DataObjectMethodAttribute(DataObjectMethodType methodType, bool isDefault)
override bool Match([NotNullWhen(true)] object? obj)