Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ImmutableObjectAttribute.cs
Go to the documentation of this file.
2
4
5[AttributeUsage(AttributeTargets.All)]
7{
8 public static readonly ImmutableObjectAttribute Yes = new ImmutableObjectAttribute(immutable: true);
9
10 public static readonly ImmutableObjectAttribute No = new ImmutableObjectAttribute(immutable: false);
11
12 public static readonly ImmutableObjectAttribute Default = No;
13
14 public bool Immutable { get; }
15
16 public ImmutableObjectAttribute(bool immutable)
17 {
18 Immutable = immutable;
19 }
20
21 public override bool Equals([NotNullWhen(true)] object? obj)
22 {
23 if (obj is ImmutableObjectAttribute immutableObjectAttribute)
24 {
25 return immutableObjectAttribute.Immutable == Immutable;
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 ImmutableObjectAttribute Yes
static readonly ImmutableObjectAttribute No
static readonly ImmutableObjectAttribute Default
override bool Equals([NotNullWhen(true)] object? obj)