using System; using Newtonsoft.Json.Converters; namespace StardewModdingAPI.Framework.Serialisation { /// A variant of which only converts a specified enum. /// The enum type. internal class StringEnumConverter : StringEnumConverter { /********* ** Public methods *********/ /// Get whether this instance can convert the specified object type. /// The object type. public override bool CanConvert(Type type) { return base.CanConvert(type) && (Nullable.GetUnderlyingType(type) ?? type) == typeof(T); } } }