Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ListBindableAttribute.cs
Go to the documentation of this file.
2
4
5[AttributeUsage(AttributeTargets.All)]
6public sealed class ListBindableAttribute : Attribute
7{
8 public static readonly ListBindableAttribute Yes = new ListBindableAttribute(listBindable: true);
9
10 public static readonly ListBindableAttribute No = new ListBindableAttribute(listBindable: false);
11
12 public static readonly ListBindableAttribute Default = Yes;
13
14 private readonly bool _isDefault;
15
16 public bool ListBindable { get; }
17
18 public ListBindableAttribute(bool listBindable)
19 {
20 ListBindable = listBindable;
21 }
22
24 {
25 ListBindable = flags != BindableSupport.No;
26 _isDefault = flags == BindableSupport.Default;
27 }
28
29 public override bool Equals([NotNullWhen(true)] object? obj)
30 {
31 if (obj == this)
32 {
33 return true;
34 }
35 if (obj is ListBindableAttribute listBindableAttribute)
36 {
37 return listBindableAttribute.ListBindable == ListBindable;
38 }
39 return false;
40 }
41
42 public override int GetHashCode()
43 {
44 return base.GetHashCode();
45 }
46
47 public override bool IsDefaultAttribute()
48 {
49 if (!Equals(Default))
50 {
51 return _isDefault;
52 }
53 return true;
54 }
55}
override bool Equals([NotNullWhen(true)] object? obj)
static readonly ListBindableAttribute No
static readonly ListBindableAttribute Yes
static readonly ListBindableAttribute Default