mirror of
https://github.com/Raymonf/whack.git
synced 2024-11-30 18:54:27 +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;
|
|
}
|
|
}
|
|
}
|