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