From 929dccb75a1405737975d76648e015a3e7c00177 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 7 Oct 2017 23:07:10 -0400 Subject: reorganise repo structure --- .../Serialisation/SelectiveStringEnumConverter.cs | 37 ---------------------- 1 file changed, 37 deletions(-) delete mode 100644 src/StardewModdingAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs (limited to 'src/StardewModdingAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs') diff --git a/src/StardewModdingAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs b/src/StardewModdingAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs deleted file mode 100644 index 37108556..00000000 --- a/src/StardewModdingAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Newtonsoft.Json.Converters; - -namespace StardewModdingAPI.Framework.Serialisation -{ - /// A variant of which only converts certain enums. - internal class SelectiveStringEnumConverter : StringEnumConverter - { - /********* - ** Properties - *********/ - /// The enum type names to convert. - private readonly HashSet Types; - - - /********* - ** Public methods - *********/ - /// Construct an instance. - /// The enum types to convert. - public SelectiveStringEnumConverter(params Type[] types) - { - this.Types = new HashSet(types.Select(p => p.FullName)); - } - - /// Get whether this instance can convert the specified object type. - /// The object type. - public override bool CanConvert(Type type) - { - return - base.CanConvert(type) - && this.Types.Contains((Nullable.GetUnderlyingType(type) ?? type).FullName); - } - } -} -- cgit