diff options
Diffstat (limited to 'src/StardewModdingAPI/Manifest.cs')
-rw-r--r-- | src/StardewModdingAPI/Manifest.cs | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/src/StardewModdingAPI/Manifest.cs b/src/StardewModdingAPI/Manifest.cs index 07dd3541..baacf954 100644 --- a/src/StardewModdingAPI/Manifest.cs +++ b/src/StardewModdingAPI/Manifest.cs @@ -1,23 +1,11 @@ using System; using Newtonsoft.Json; +using StardewModdingAPI.Framework.Serialisation; namespace StardewModdingAPI { - /// <summary>Wraps <see cref="Manifest"/> so it can implement <see cref="IManifest"/> without breaking backwards compatibility.</summary> - [Obsolete("Use " + nameof(IManifest) + " or " + nameof(Mod) + "." + nameof(Mod.ModManifest) + " instead")] - internal class ManifestImpl : Manifest, IManifest - { - /// <summary>The mod version.</summary> - [JsonProperty("Version", ObjectCreationHandling = ObjectCreationHandling.Auto/* avoids issue where Json.NET can't determine concrete type for interface */)] - public new ISemanticVersion Version - { - get { return base.Version; } - set { base.Version = (Version)value; } - } - } - /// <summary>A manifest which describes a mod for SMAPI.</summary> - public class Manifest + public class Manifest : IManifest { /********* ** Accessors @@ -32,7 +20,8 @@ namespace StardewModdingAPI public string Author { get; set; } /// <summary>The mod version.</summary> - public Version Version { get; set; } = new Version(0, 0, 0, "", suppressDeprecationWarning: true); + [JsonConverter(typeof(SemanticVersionConverter))] + public ISemanticVersion Version { get; set; } /// <summary>The minimum SMAPI version required by this mod, if any.</summary> public string MinimumApiVersion { get; set; } @@ -43,26 +32,6 @@ namespace StardewModdingAPI /// <summary>The unique mod ID.</summary> public string UniqueID { get; set; } - - /**** - ** Obsolete - ****/ - /// <summary>Whether the manifest defined the deprecated <see cref="Authour"/> field.</summary> - [JsonIgnore] - internal bool UsedAuthourField { get; private set; } - - /// <summary>Obsolete.</summary> - [Obsolete("Use " + nameof(Manifest) + "." + nameof(Manifest.Author) + ".")] - public virtual string Authour - { - get { return this.Author; } - set - { - this.UsedAuthourField = true; - this.Author = value; - } - } - /// <summary>Whether the mod uses per-save config files.</summary> [Obsolete("Use " + nameof(Mod) + "." + nameof(Mod.Helper) + "." + nameof(IModHelper.ReadConfig) + " instead")] public bool PerSaveConfigs { get; set; } |