Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DescriptionAttribute.cs
Go to the documentation of this file.
2
4
5[AttributeUsage(AttributeTargets.All)]
7{
8 public static readonly DescriptionAttribute Default = new DescriptionAttribute();
9
10 public virtual string Description => DescriptionValue;
11
12 protected string DescriptionValue { get; set; }
13
15 : this(string.Empty)
16 {
17 }
18
19 public DescriptionAttribute(string description)
20 {
21 DescriptionValue = description;
22 }
23
24 public override bool Equals([NotNullWhen(true)] object? obj)
25 {
26 if (obj is DescriptionAttribute descriptionAttribute)
27 {
28 return descriptionAttribute.Description == Description;
29 }
30 return false;
31 }
32
33 public override int GetHashCode()
34 {
35 return Description?.GetHashCode() ?? 0;
36 }
37
38 public override bool IsDefaultAttribute()
39 {
40 return Equals(Default);
41 }
42}
override bool Equals([NotNullWhen(true)] object? obj)
static readonly DescriptionAttribute Default