1
0
mirror of https://github.com/Raymonf/whack.git synced 2024-11-30 18:54:27 +01:00
whack/WTT/UAssetAPI/JSON/UAssetContractResolver.cs
2022-09-28 18:39:41 -04:00

28 lines
757 B
C#

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using UAssetAPI.UnrealTypes;
namespace UAssetAPI.JSON
{
public class UAssetContractResolver : DefaultContractResolver
{
public Dictionary<FName, string> ToBeFilled;
protected override JsonConverter ResolveContractConverter(Type objectType)
{
if (typeof(FName).IsAssignableFrom(objectType))
{
return new FNameJsonConverter(ToBeFilled);
}
return base.ResolveContractConverter(objectType);
}
public UAssetContractResolver(Dictionary<FName, string> toBeFilled) : base()
{
ToBeFilled = toBeFilled;
}
}
}