punish v6.8.18.0
This commit is contained in:
commit
060278c1b7
317 changed files with 554155 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Questionable.Model.Questing.Converter;
|
||||
|
||||
public sealed class ElementIdConverter : JsonConverter<ElementId>
|
||||
{
|
||||
public override ElementId Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.Number)
|
||||
{
|
||||
return new QuestId(reader.GetUInt16());
|
||||
}
|
||||
return ElementId.FromString(reader.GetString() ?? throw new JsonException());
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, ElementId value, JsonSerializerOptions options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue