Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MergablePropertyAttribute.cs
Go to the documentation of this file.
2
4
5[AttributeUsage(AttributeTargets.All)]
7{
8 public static readonly MergablePropertyAttribute Yes = new MergablePropertyAttribute(allowMerge: true);
9
10 public static readonly MergablePropertyAttribute No = new MergablePropertyAttribute(allowMerge: false);
11
12 public static readonly MergablePropertyAttribute Default = Yes;
13
14 public bool AllowMerge { get; }
15
16 public MergablePropertyAttribute(bool allowMerge)
17 {
18 AllowMerge = allowMerge;
19 }
20
21 public override bool Equals([NotNullWhen(true)] object? obj)
22 {
23 if (obj is MergablePropertyAttribute mergablePropertyAttribute)
24 {
25 return mergablePropertyAttribute.AllowMerge == AllowMerge;
26 }
27 return false;
28 }
29
30 public override int GetHashCode()
31 {
32 return base.GetHashCode();
33 }
34
35 public override bool IsDefaultAttribute()
36 {
37 return Equals(Default);
38 }
39}
static readonly MergablePropertyAttribute Yes
static readonly MergablePropertyAttribute Default
override bool Equals([NotNullWhen(true)] object? obj)
static readonly MergablePropertyAttribute No