Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
InheritanceAttribute.cs
Go to the documentation of this file.
2
4
5[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event)]
6public sealed class InheritanceAttribute : Attribute
7{
8 public static readonly InheritanceAttribute Inherited = new InheritanceAttribute(InheritanceLevel.Inherited);
9
10 public static readonly InheritanceAttribute InheritedReadOnly = new InheritanceAttribute(InheritanceLevel.InheritedReadOnly);
11
12 public static readonly InheritanceAttribute NotInherited = new InheritanceAttribute(InheritanceLevel.NotInherited);
13
14 public static readonly InheritanceAttribute Default = NotInherited;
15
17
19 {
20 InheritanceLevel = Default.InheritanceLevel;
21 }
22
23 public InheritanceAttribute(InheritanceLevel inheritanceLevel)
24 {
25 InheritanceLevel = inheritanceLevel;
26 }
27
28 public override bool Equals([NotNullWhen(true)] object? value)
29 {
30 if (value == this)
31 {
32 return true;
33 }
35 {
36 return false;
37 }
38 InheritanceLevel inheritanceLevel = ((InheritanceAttribute)value).InheritanceLevel;
39 return inheritanceLevel == InheritanceLevel;
40 }
41
42 public override int GetHashCode()
43 {
44 return base.GetHashCode();
45 }
46
47 public override bool IsDefaultAttribute()
48 {
49 return Equals(Default);
50 }
51
52 public override string ToString()
53 {
55 }
56}
static readonly InheritanceAttribute Inherited
static readonly InheritanceAttribute Default
static readonly InheritanceAttribute NotInherited
override bool Equals([NotNullWhen(true)] object? value)
static readonly InheritanceAttribute InheritedReadOnly
InheritanceAttribute(InheritanceLevel inheritanceLevel)
static TypeConverter GetConverterTrimUnsafe([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)