mirror of
https://github.com/Raymonf/whack.git
synced 2024-12-11 07:26:09 +01:00
28 lines
757 B
C#
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;
|
|
}
|
|
}
|
|
}
|