Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ArrayShapeEncoder.cs
Go to the documentation of this file.
1
using
System.Collections.Immutable
;
2
3
namespace
System.Reflection.Metadata.Ecma335
;
4
5
public
readonly
struct
ArrayShapeEncoder
6
{
7
public
BlobBuilder
Builder
{
get
; }
8
9
public
ArrayShapeEncoder
(
BlobBuilder
builder)
10
{
11
Builder
= builder;
12
}
13
14
public
void
Shape
(
int
rank,
ImmutableArray<int>
sizes,
ImmutableArray<int>
lowerBounds
)
15
{
16
if
((uint)(rank - 1) > 65534u)
17
{
18
Throw
.
ArgumentOutOfRange
(
"rank"
);
19
}
20
if
(sizes.
IsDefault
)
21
{
22
Throw
.
ArgumentNull
(
"sizes"
);
23
}
24
Builder
.
WriteCompressedInteger
(rank);
25
if
(sizes.
Length
> rank)
26
{
27
Throw
.
ArgumentOutOfRange
(
"rank"
);
28
}
29
Builder
.
WriteCompressedInteger
(sizes.
Length
);
30
ImmutableArray<int>
.
Enumerator
enumerator = sizes.
GetEnumerator
();
31
while
(enumerator.MoveNext())
32
{
33
int
current = enumerator.
Current
;
34
Builder
.
WriteCompressedInteger
(current);
35
}
36
if
(
lowerBounds
.IsDefault)
37
{
38
Builder
.
WriteCompressedInteger
(rank);
39
for
(
int
i = 0; i < rank; i++)
40
{
41
Builder
.
WriteCompressedSignedInteger
(0);
42
}
43
return
;
44
}
45
if
(
lowerBounds
.Length > rank)
46
{
47
Throw
.
ArgumentOutOfRange
(
"rank"
);
48
}
49
Builder
.
WriteCompressedInteger
(
lowerBounds
.Length);
50
ImmutableArray<int>
.
Enumerator
enumerator2 =
lowerBounds
.GetEnumerator();
51
while
(enumerator2.MoveNext())
52
{
53
int
current2 = enumerator2.
Current
;
54
Builder
.
WriteCompressedSignedInteger
(current2);
55
}
56
}
57
}
System.Collections.Immutable.ImmutableArray.GetEnumerator
Enumerator GetEnumerator()
Definition
ImmutableArray.cs:1641
System.Collections.Immutable.ImmutableArray.Length
int Length
Definition
ImmutableArray.cs:878
System.Collections.Immutable.ImmutableArray.IsDefault
bool IsDefault
Definition
ImmutableArray.cs:887
System.Collections.Immutable.ImmutableArray
Definition
ImmutableArray.cs:223
System.Reflection.Metadata.BlobBuilder.WriteCompressedInteger
void WriteCompressedInteger(int value)
Definition
BlobBuilder.cs:895
System.Reflection.Metadata.BlobBuilder.WriteCompressedSignedInteger
void WriteCompressedSignedInteger(int value)
Definition
BlobBuilder.cs:890
System.Reflection.Metadata.BlobBuilder
Definition
BlobBuilder.cs:14
System.Reflection.Throw.ArgumentNull
static void ArgumentNull(string parameterName)
Definition
Throw.cs:110
System.Reflection.Throw.ArgumentOutOfRange
static void ArgumentOutOfRange(string parameterName)
Definition
Throw.cs:145
System.Reflection.Throw
Definition
Throw.cs:9
System.Collections.Immutable
Definition
AllocFreeConcurrentStack.cs:4
System.Reflection.Metadata.Ecma335
Definition
ArrayShapeEncoder.cs:3
System.ExceptionArgument.lowerBounds
@ lowerBounds
System.Collections.Immutable.ImmutableArray.Enumerator.Current
T Current
Definition
ImmutableArray.cs:687
System.Collections.Immutable.ImmutableArray.Enumerator
Definition
ImmutableArray.cs:682
System.Reflection.Metadata.Ecma335.ArrayShapeEncoder.ArrayShapeEncoder
ArrayShapeEncoder(BlobBuilder builder)
Definition
ArrayShapeEncoder.cs:9
System.Reflection.Metadata.Ecma335.ArrayShapeEncoder.Shape
void Shape(int rank, ImmutableArray< int > sizes, ImmutableArray< int > lowerBounds)
Definition
ArrayShapeEncoder.cs:14
System.Reflection.Metadata.Ecma335.ArrayShapeEncoder.Builder
BlobBuilder Builder
Definition
ArrayShapeEncoder.cs:7
System.Reflection.Metadata.Ecma335.ArrayShapeEncoder
Definition
ArrayShapeEncoder.cs:6
source
System.Reflection.Metadata
System.Reflection.Metadata.Ecma335
ArrayShapeEncoder.cs
Generated by
1.10.0