diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-06-02 17:54:01 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-06-02 17:54:01 -0400 |
commit | b6cda8f0d32898f34b5c7dc703a85aa823c317ce (patch) | |
tree | 91d95583b6af5ce842a3d8208aacb225bdd822d6 /src/SMAPI/SemanticVersion.cs | |
parent | 2e3c42130358734a6fcf547745324dd272176f9c (diff) | |
parent | 9945408aa4ea2f6e07c2820f6aa1c160c68423d5 (diff) | |
download | SMAPI-b6cda8f0d32898f34b5c7dc703a85aa823c317ce.tar.gz SMAPI-b6cda8f0d32898f34b5c7dc703a85aa823c317ce.tar.bz2 SMAPI-b6cda8f0d32898f34b5c7dc703a85aa823c317ce.zip |
Merge branch 'create-toolkit' into develop
Diffstat (limited to 'src/SMAPI/SemanticVersion.cs')
-rw-r--r-- | src/SMAPI/SemanticVersion.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/SMAPI/SemanticVersion.cs b/src/SMAPI/SemanticVersion.cs index 9db1cf14..3ee3ccf3 100644 --- a/src/SMAPI/SemanticVersion.cs +++ b/src/SMAPI/SemanticVersion.cs @@ -1,6 +1,5 @@ using System; using Newtonsoft.Json; -using StardewModdingAPI.Internal; namespace StardewModdingAPI { @@ -11,7 +10,7 @@ namespace StardewModdingAPI ** Properties *********/ /// <summary>The underlying semantic version implementation.</summary> - private readonly SemanticVersionImpl Version; + private readonly Toolkit.ISemanticVersion Version; /********* @@ -40,20 +39,20 @@ namespace StardewModdingAPI /// <param name="build">An optional build tag.</param> [JsonConstructor] public SemanticVersion(int majorVersion, int minorVersion, int patchVersion, string build = null) - : this(new SemanticVersionImpl(majorVersion, minorVersion, patchVersion, build)) { } + : this(new Toolkit.SemanticVersion(majorVersion, minorVersion, patchVersion, build)) { } /// <summary>Construct an instance.</summary> /// <param name="version">The semantic version string.</param> /// <exception cref="ArgumentNullException">The <paramref name="version"/> is null.</exception> /// <exception cref="FormatException">The <paramref name="version"/> is not a valid semantic version.</exception> public SemanticVersion(string version) - : this(new SemanticVersionImpl(version)) { } + : this(new Toolkit.SemanticVersion(version)) { } /// <summary>Construct an instance.</summary> /// <param name="version">The assembly version.</param> /// <exception cref="ArgumentNullException">The <paramref name="version"/> is null.</exception> public SemanticVersion(Version version) - : this(new SemanticVersionImpl(version)) { } + : this(new Toolkit.SemanticVersion(version)) { } /// <summary>Whether this is a pre-release version.</summary> public bool IsPrerelease() @@ -67,7 +66,8 @@ namespace StardewModdingAPI /// <remarks>The implementation is defined by Semantic Version 2.0 (http://semver.org/).</remarks> public int CompareTo(ISemanticVersion other) { - return this.Version.CompareTo(other.MajorVersion, other.MinorVersion, other.PatchVersion, other.Build); + Toolkit.ISemanticVersion toolkitOther = new Toolkit.SemanticVersion(other.MajorVersion, other.MinorVersion, other.PatchVersion, other.Build); + return this.Version.CompareTo(toolkitOther); } /// <summary>Get whether this version is older than the specified version.</summary> @@ -137,7 +137,7 @@ namespace StardewModdingAPI /// <returns>Returns whether parsing the version succeeded.</returns> internal static bool TryParse(string version, out ISemanticVersion parsed) { - if (SemanticVersionImpl.TryParse(version, out SemanticVersionImpl versionImpl)) + if (Toolkit.SemanticVersion.TryParse(version, out Toolkit.ISemanticVersion versionImpl)) { parsed = new SemanticVersion(versionImpl); return true; @@ -153,7 +153,7 @@ namespace StardewModdingAPI *********/ /// <summary>Construct an instance.</summary> /// <param name="version">The underlying semantic version implementation.</param> - private SemanticVersion(SemanticVersionImpl version) + private SemanticVersion(Toolkit.ISemanticVersion version) { this.Version = version; } |