Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
GuidHandle.cs
Go to the documentation of this file.
1
using
System.Diagnostics.CodeAnalysis
;
2
3
namespace
System.Reflection.Metadata
;
4
5
public
readonly
struct
GuidHandle
:
IEquatable
<GuidHandle>
6
{
7
private
readonly
int
_index
;
8
9
public
bool
IsNil
=>
_index
== 0;
10
11
internal
int
Index
=>
_index
;
12
13
private
GuidHandle
(
int
index
)
14
{
15
_index
=
index
;
16
}
17
18
internal
static
GuidHandle
FromIndex
(
int
heapIndex)
19
{
20
return
new
GuidHandle
(heapIndex);
21
}
22
23
public
static
implicit
operator
Handle
(
GuidHandle
handle
)
24
{
25
return
new
Handle
(114,
handle
._index);
26
}
27
28
public
static
explicit
operator
GuidHandle
(
Handle
handle
)
29
{
30
if
(
handle
.VType != 114)
31
{
32
Throw
.
InvalidCast
();
33
}
34
return
new
GuidHandle
(
handle
.Offset);
35
}
36
37
public
override
bool
Equals
([NotNullWhen(
true
)]
object
?
obj
)
38
{
39
if
(
obj
is
GuidHandle
other
)
40
{
41
return
Equals
(
other
);
42
}
43
return
false
;
44
}
45
46
public
bool
Equals
(
GuidHandle
other
)
47
{
48
return
_index
==
other
._index;
49
}
50
51
public
override
int
GetHashCode
()
52
{
53
return
_index
;
54
}
55
56
public
static
bool
operator ==
(
GuidHandle
left,
GuidHandle
right)
57
{
58
return
left.
Equals
(right);
59
}
60
61
public
static
bool
operator !=
(
GuidHandle
left,
GuidHandle
right)
62
{
63
return
!left.
Equals
(right);
64
}
65
}
System.Reflection.Throw.InvalidCast
static void InvalidCast()
Definition
Throw.cs:12
System.Reflection.Throw
Definition
Throw.cs:9
System.IEquatable
Definition
IEquatable.cs:4
System.Diagnostics.CodeAnalysis
Definition
AllowNullAttribute.cs:1
System.Reflection.Metadata
Definition
AssemblyExtensions.cs:4
System.ExceptionArgument.index
@ index
System.ExceptionArgument.other
@ other
System.ExceptionArgument.obj
@ obj
System.ExceptionArgument.handle
@ handle
System.Index
Definition
Index.cs:7
System.Reflection.Metadata.GuidHandle.operator!=
static bool operator!=(GuidHandle left, GuidHandle right)
Definition
GuidHandle.cs:61
System.Reflection.Metadata.GuidHandle.operator==
static bool operator==(GuidHandle left, GuidHandle right)
Definition
GuidHandle.cs:56
System.Reflection.Metadata.GuidHandle.IsNil
bool IsNil
Definition
GuidHandle.cs:9
System.Reflection.Metadata.GuidHandle.GetHashCode
override int GetHashCode()
Definition
GuidHandle.cs:51
System.Reflection.Metadata.GuidHandle.FromIndex
static GuidHandle FromIndex(int heapIndex)
Definition
GuidHandle.cs:18
System.Reflection.Metadata.GuidHandle.GuidHandle
GuidHandle(int index)
Definition
GuidHandle.cs:13
System.Reflection.Metadata.GuidHandle.Equals
override bool Equals([NotNullWhen(true)] object? obj)
Definition
GuidHandle.cs:37
System.Reflection.Metadata.GuidHandle.Equals
bool Equals(GuidHandle other)
Definition
GuidHandle.cs:46
System.Reflection.Metadata.GuidHandle._index
readonly int _index
Definition
GuidHandle.cs:7
System.Reflection.Metadata.GuidHandle
Definition
GuidHandle.cs:6
System.Reflection.Metadata.Handle
Definition
Handle.cs:6
source
System.Reflection.Metadata
System.Reflection.Metadata
GuidHandle.cs
Generated by
1.10.0