1
0
forked from liza/Questionable
Questionable/Questionable.Model/Questing/Converter/ElementIdConverter.cs

20 lines
557 B
C#
Raw Normal View History

2024-08-03 20:17:18 +00:00
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Questionable.Model.Questing.Converter;
public class ElementIdConverter : JsonConverter<ElementId>
{
public override ElementId Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
uint value = reader.GetUInt32();
return ElementId.From(value);
}
public override void Write(Utf8JsonWriter writer, ElementId value, JsonSerializerOptions options)
{
throw new NotImplementedException();
}
}