Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MetadataWriterUtilities.cs
Go to the documentation of this file.
2
4
5internal static class MetadataWriterUtilities
6{
8 {
9 if (value == null)
10 {
11 return (SignatureTypeCode)18;
12 }
13 if (value.GetType() == typeof(int))
14 {
15 return SignatureTypeCode.Int32;
16 }
17 if (value.GetType() == typeof(string))
18 {
19 return SignatureTypeCode.String;
20 }
21 if (value.GetType() == typeof(bool))
22 {
23 return SignatureTypeCode.Boolean;
24 }
25 if (value.GetType() == typeof(char))
26 {
27 return SignatureTypeCode.Char;
28 }
29 if (value.GetType() == typeof(byte))
30 {
31 return SignatureTypeCode.Byte;
32 }
33 if (value.GetType() == typeof(long))
34 {
35 return SignatureTypeCode.Int64;
36 }
37 if (value.GetType() == typeof(double))
38 {
39 return SignatureTypeCode.Double;
40 }
41 if (value.GetType() == typeof(short))
42 {
43 return SignatureTypeCode.Int16;
44 }
45 if (value.GetType() == typeof(ushort))
46 {
47 return SignatureTypeCode.UInt16;
48 }
49 if (value.GetType() == typeof(uint))
50 {
51 return SignatureTypeCode.UInt32;
52 }
53 if (value.GetType() == typeof(sbyte))
54 {
55 return SignatureTypeCode.SByte;
56 }
57 if (value.GetType() == typeof(ulong))
58 {
59 return SignatureTypeCode.UInt64;
60 }
61 if (value.GetType() == typeof(float))
62 {
63 return SignatureTypeCode.Single;
64 }
66 }
67
69 {
70 for (int i = 0; i < rowCounts.Length; i++)
71 {
72 int num = rowCounts[i];
73 if (num > 0)
74 {
75 writer.WriteInt32(num);
76 }
77 }
78 }
79}
static void SerializeRowCounts(BlobBuilder writer, ImmutableArray< int > rowCounts)
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string InvalidConstantValueOfType
Definition SR.cs:130
Definition SR.cs:7