Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Encode()

void System.Diagnostics.Tracing.FieldMetadata.Encode ( ref int pos,
byte[] metadata )
inline

Definition at line 74 of file FieldMetadata.cs.

75 {
76 if (metadata != null)
77 {
78 Encoding.UTF8.GetBytes(name, 0, name.Length, metadata, pos);
79 }
80 pos += nameSize;
81 if (metadata != null)
82 {
83 metadata[pos] = inType;
84 }
85 pos++;
86 if ((inType & 0x80u) != 0)
87 {
88 if (metadata != null)
89 {
90 metadata[pos] = outType;
91 }
92 pos++;
93 if ((outType & 0x80u) != 0)
94 {
95 Statics.EncodeTags((int)tags, ref pos, metadata);
96 }
97 }
98 if ((inType & 0x20) == 0)
99 {
100 return;
101 }
102 if (metadata != null)
103 {
104 metadata[pos] = (byte)fixedCount;
105 metadata[pos + 1] = (byte)(fixedCount >> 8);
106 }
107 pos += 2;
108 if (96 == (inType & 0x60) && fixedCount != 0)
109 {
110 if (metadata != null)
111 {
112 Buffer.BlockCopy(custom, 0, metadata, pos, fixedCount);
113 }
114 pos += fixedCount;
115 }
116 }
static Encoding UTF8
Definition Encoding.cs:526

References System.Buffer.BlockCopy(), System.Diagnostics.Tracing.FieldMetadata.custom, System.Diagnostics.Tracing.Statics.EncodeTags(), System.Diagnostics.Tracing.FieldMetadata.fixedCount, System.Diagnostics.Tracing.FieldMetadata.inType, System.Diagnostics.Tracing.FieldMetadata.name, System.Diagnostics.Tracing.FieldMetadata.nameSize, System.Diagnostics.Tracing.FieldMetadata.outType, System.Diagnostics.Tracing.FieldMetadata.tags, and System.Text.Encoding.UTF8.