Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CustomDebugInformationHandle.cs
Go to the documentation of this file.
2
4
5public readonly struct CustomDebugInformationHandle : IEquatable<CustomDebugInformationHandle>
6{
7 private readonly int _rowId;
8
9 public bool IsNil => RowId == 0;
10
11 internal int RowId => _rowId;
12
14 {
15 _rowId = rowId;
16 }
17
18 internal static CustomDebugInformationHandle FromRowId(int rowId)
19 {
20 return new CustomDebugInformationHandle(rowId);
21 }
22
23 public static implicit operator Handle(CustomDebugInformationHandle handle)
24 {
25 return new Handle(55, handle._rowId);
26 }
27
28 public static implicit operator EntityHandle(CustomDebugInformationHandle handle)
29 {
30 return new EntityHandle((uint)(0x37000000uL | (ulong)handle._rowId));
31 }
32
33 public static explicit operator CustomDebugInformationHandle(Handle handle)
34 {
35 if (handle.VType != 55)
36 {
38 }
39 return new CustomDebugInformationHandle(handle.RowId);
40 }
41
42 public static explicit operator CustomDebugInformationHandle(EntityHandle handle)
43 {
44 if (handle.VType != 922746880)
45 {
47 }
48 return new CustomDebugInformationHandle(handle.RowId);
49 }
50
52 {
53 return left._rowId == right._rowId;
54 }
55
56 public override bool Equals([NotNullWhen(true)] object? obj)
57 {
58 if (obj is CustomDebugInformationHandle customDebugInformationHandle)
59 {
60 return customDebugInformationHandle._rowId == _rowId;
61 }
62 return false;
63 }
64
66 {
67 return _rowId == other._rowId;
68 }
69
70 public override int GetHashCode()
71 {
72 return _rowId.GetHashCode();
73 }
74
76 {
77 return left._rowId != right._rowId;
78 }
79}
static void InvalidCast()
Definition Throw.cs:12
static CustomDebugInformationHandle FromRowId(int rowId)
static bool operator!=(CustomDebugInformationHandle left, CustomDebugInformationHandle right)
override bool Equals([NotNullWhen(true)] object? obj)
static bool operator==(CustomDebugInformationHandle left, CustomDebugInformationHandle right)