Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
UInt32Converter.cs
Go to the documentation of this file.
2
3internal sealed class UInt32Converter : JsonConverter<uint>
4{
9
11 {
12 return reader.GetUInt32();
13 }
14
16 {
17 writer.WriteNumberValue((ulong)value);
18 }
19
21 {
22 return reader.GetUInt32WithQuotes();
23 }
24
26 {
27 writer.WritePropertyName(value);
28 }
29
31 {
32 if (reader.TokenType == JsonTokenType.String && (JsonNumberHandling.AllowReadingFromString & handling) != 0)
33 {
34 return reader.GetUInt32WithQuotes();
35 }
36 return reader.GetUInt32();
37 }
38
40 {
41 if ((JsonNumberHandling.WriteAsString & handling) != 0)
42 {
43 writer.WriteNumberValueAsString(value);
44 }
45 else
46 {
47 writer.WriteNumberValue((ulong)value);
48 }
49 }
50}
override void Write(Utf8JsonWriter writer, uint value, JsonSerializerOptions options)
override void WriteNumberWithCustomHandling(Utf8JsonWriter writer, uint value, JsonNumberHandling handling)
override void WriteAsPropertyNameCore(Utf8JsonWriter writer, uint value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
override uint ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
override uint Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
override uint ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)