From 3da27346c6886fff4afb35d7fb46345c92ef1197 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 12 May 2017 01:15:02 -0400 Subject: add basic dependencies to manifest (#285) --- .../Serialisation/SemanticVersionConverter.cs | 51 ---------------------- 1 file changed, 51 deletions(-) delete mode 100644 src/StardewModdingAPI/Framework/Serialisation/SemanticVersionConverter.cs (limited to 'src/StardewModdingAPI/Framework/Serialisation/SemanticVersionConverter.cs') diff --git a/src/StardewModdingAPI/Framework/Serialisation/SemanticVersionConverter.cs b/src/StardewModdingAPI/Framework/Serialisation/SemanticVersionConverter.cs deleted file mode 100644 index 52ec999e..00000000 --- a/src/StardewModdingAPI/Framework/Serialisation/SemanticVersionConverter.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace StardewModdingAPI.Framework.Serialisation -{ - /// Overrides how SMAPI reads and writes . - internal class SemanticVersionConverter : JsonConverter - { - /********* - ** Accessors - *********/ - /// Whether this converter can write JSON. - public override bool CanWrite => false; - - - /********* - ** Public methods - *********/ - /// Get whether this instance can convert the specified object type. - /// The object type. - public override bool CanConvert(Type objectType) - { - return objectType == typeof(ISemanticVersion); - } - - /// Reads the JSON representation of the object. - /// The JSON reader. - /// The object type. - /// The object being read. - /// The calling serializer. - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - JObject obj = JObject.Load(reader); - int major = obj.Value("MajorVersion"); - int minor = obj.Value("MinorVersion"); - int patch = obj.Value("PatchVersion"); - string build = obj.Value("Build"); - return new SemanticVersion(major, minor, patch, build); - } - - /// Writes the JSON representation of the object. - /// The JSON writer. - /// The value. - /// The calling serializer. - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new InvalidOperationException("This converter does not write JSON."); - } - } -} -- cgit