Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TypeSpecificationHandle.cs
Go to the documentation of this file.
1
namespace
System.Reflection.Metadata
;
2
3
public
readonly
struct
TypeSpecificationHandle
:
IEquatable
<TypeSpecificationHandle>
4
{
5
private
readonly
int
_rowId
;
6
7
public
bool
IsNil
=>
RowId
== 0;
8
9
internal
int
RowId
=>
_rowId
;
10
11
private
TypeSpecificationHandle
(
int
rowId)
12
{
13
_rowId
= rowId;
14
}
15
16
internal
static
TypeSpecificationHandle
FromRowId
(
int
rowId)
17
{
18
return
new
TypeSpecificationHandle
(rowId);
19
}
20
21
public
static
implicit
operator
Handle
(
TypeSpecificationHandle
handle
)
22
{
23
return
new
Handle
(27,
handle
._rowId);
24
}
25
26
public
static
implicit
operator
EntityHandle
(
TypeSpecificationHandle
handle
)
27
{
28
return
new
EntityHandle
((uint)(0x1B000000uL | (ulong)
handle
._rowId));
29
}
30
31
public
static
explicit
operator
TypeSpecificationHandle
(
Handle
handle
)
32
{
33
if
(
handle
.VType != 27)
34
{
35
Throw
.
InvalidCast
();
36
}
37
return
new
TypeSpecificationHandle
(
handle
.RowId);
38
}
39
40
public
static
explicit
operator
TypeSpecificationHandle
(
EntityHandle
handle
)
41
{
42
if
(
handle
.VType != 452984832)
43
{
44
Throw
.
InvalidCast
();
45
}
46
return
new
TypeSpecificationHandle
(
handle
.RowId);
47
}
48
49
public
static
bool
operator ==
(
TypeSpecificationHandle
left,
TypeSpecificationHandle
right)
50
{
51
return
left._rowId == right.
_rowId
;
52
}
53
54
public
override
bool
Equals
(
object
?
obj
)
55
{
56
if
(
obj
is
TypeSpecificationHandle
)
57
{
58
return
((
TypeSpecificationHandle
)
obj
)._rowId ==
_rowId
;
59
}
60
return
false
;
61
}
62
63
public
bool
Equals
(
TypeSpecificationHandle
other
)
64
{
65
return
_rowId
==
other
._rowId;
66
}
67
68
public
override
int
GetHashCode
()
69
{
70
return
_rowId
.GetHashCode();
71
}
72
73
public
static
bool
operator !=
(
TypeSpecificationHandle
left,
TypeSpecificationHandle
right)
74
{
75
return
left._rowId != right.
_rowId
;
76
}
77
}
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.Reflection.Metadata
Definition
AssemblyExtensions.cs:4
System.ExceptionArgument.other
@ other
System.ExceptionArgument.obj
@ obj
System.ExceptionArgument.handle
@ handle
System.Reflection.Metadata.EntityHandle
Definition
EntityHandle.cs:6
System.Reflection.Metadata.Handle
Definition
Handle.cs:6
System.Reflection.Metadata.TypeSpecificationHandle.TypeSpecificationHandle
TypeSpecificationHandle(int rowId)
Definition
TypeSpecificationHandle.cs:11
System.Reflection.Metadata.TypeSpecificationHandle.operator==
static bool operator==(TypeSpecificationHandle left, TypeSpecificationHandle right)
Definition
TypeSpecificationHandle.cs:49
System.Reflection.Metadata.TypeSpecificationHandle.Equals
override bool Equals(object? obj)
Definition
TypeSpecificationHandle.cs:54
System.Reflection.Metadata.TypeSpecificationHandle._rowId
readonly int _rowId
Definition
TypeSpecificationHandle.cs:5
System.Reflection.Metadata.TypeSpecificationHandle.RowId
int RowId
Definition
TypeSpecificationHandle.cs:9
System.Reflection.Metadata.TypeSpecificationHandle.IsNil
bool IsNil
Definition
TypeSpecificationHandle.cs:7
System.Reflection.Metadata.TypeSpecificationHandle.GetHashCode
override int GetHashCode()
Definition
TypeSpecificationHandle.cs:68
System.Reflection.Metadata.TypeSpecificationHandle.operator!=
static bool operator!=(TypeSpecificationHandle left, TypeSpecificationHandle right)
Definition
TypeSpecificationHandle.cs:73
System.Reflection.Metadata.TypeSpecificationHandle.FromRowId
static TypeSpecificationHandle FromRowId(int rowId)
Definition
TypeSpecificationHandle.cs:16
System.Reflection.Metadata.TypeSpecificationHandle.Equals
bool Equals(TypeSpecificationHandle other)
Definition
TypeSpecificationHandle.cs:63
System.Reflection.Metadata.TypeSpecificationHandle
Definition
TypeSpecificationHandle.cs:4
source
System.Reflection.Metadata
System.Reflection.Metadata
TypeSpecificationHandle.cs
Generated by
1.10.0