Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
LiteralEncoder.cs
Go to the documentation of this file.
2
3public readonly struct LiteralEncoder
4{
5 public BlobBuilder Builder { get; }
6
7 public LiteralEncoder(BlobBuilder builder)
8 {
9 Builder = builder;
10 }
11
13 {
14 return new VectorEncoder(Builder);
15 }
16
17 public void TaggedVector(out CustomAttributeArrayTypeEncoder arrayType, out VectorEncoder vector)
18 {
20 vector = new VectorEncoder(Builder);
21 }
22
23 public void TaggedVector(Action<CustomAttributeArrayTypeEncoder> arrayType, Action<VectorEncoder> vector)
24 {
25 if (arrayType == null)
26 {
27 Throw.ArgumentNull("arrayType");
28 }
29 if (vector == null)
30 {
31 Throw.ArgumentNull("vector");
32 }
33 TaggedVector(out var arrayType2, out var vector2);
34 arrayType(arrayType2);
35 vector(vector2);
36 }
37
39 {
40 return new ScalarEncoder(Builder);
41 }
42
48
49 public void TaggedScalar(Action<CustomAttributeElementTypeEncoder> type, Action<ScalarEncoder> scalar)
50 {
51 if (type == null)
52 {
53 Throw.ArgumentNull("type");
54 }
55 if (scalar == null)
56 {
57 Throw.ArgumentNull("scalar");
58 }
59 TaggedScalar(out var type2, out var scalar2);
60 type(type2);
61 scalar(scalar2);
62 }
63}
static void ArgumentNull(string parameterName)
Definition Throw.cs:110
void TaggedVector(out CustomAttributeArrayTypeEncoder arrayType, out VectorEncoder vector)
void TaggedVector(Action< CustomAttributeArrayTypeEncoder > arrayType, Action< VectorEncoder > vector)
void TaggedScalar(out CustomAttributeElementTypeEncoder type, out ScalarEncoder scalar)
void TaggedScalar(Action< CustomAttributeElementTypeEncoder > type, Action< ScalarEncoder > scalar)