Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DocumentNameBlobHandle.cs
Go to the documentation of this file.
2
4
5public readonly struct DocumentNameBlobHandle : IEquatable<DocumentNameBlobHandle>
6{
7 private readonly int _heapOffset;
8
9 public bool IsNil => _heapOffset == 0;
10
11 private DocumentNameBlobHandle(int heapOffset)
12 {
13 _heapOffset = heapOffset;
14 }
15
16 internal static DocumentNameBlobHandle FromOffset(int heapOffset)
17 {
18 return new DocumentNameBlobHandle(heapOffset);
19 }
20
21 public static implicit operator BlobHandle(DocumentNameBlobHandle handle)
22 {
23 return BlobHandle.FromOffset(handle._heapOffset);
24 }
25
26 public static explicit operator DocumentNameBlobHandle(BlobHandle handle)
27 {
28 if (handle.IsVirtual)
29 {
31 }
32 return FromOffset(handle.GetHeapOffset());
33 }
34
35 public override bool Equals([NotNullWhen(true)] object? obj)
36 {
38 {
39 return Equals(other);
40 }
41 return false;
42 }
43
45 {
46 return _heapOffset == other._heapOffset;
47 }
48
49 public override int GetHashCode()
50 {
51 return _heapOffset;
52 }
53
55 {
56 return left.Equals(right);
57 }
58
60 {
61 return !left.Equals(right);
62 }
63}
static void InvalidCast()
Definition Throw.cs:12
static BlobHandle FromOffset(int heapOffset)
Definition BlobHandle.cs:34
static bool operator==(DocumentNameBlobHandle left, DocumentNameBlobHandle right)
override bool Equals([NotNullWhen(true)] object? obj)
static DocumentNameBlobHandle FromOffset(int heapOffset)
static bool operator!=(DocumentNameBlobHandle left, DocumentNameBlobHandle right)