diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-03-11 20:45:58 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-03-11 20:45:58 -0400 |
commit | 98fa9f03891e3dc487bee6dcb3756e6251c67aef (patch) | |
tree | 03413377cf0810b4c9f8cf1a9c63b49ff197789b /src/SMAPI | |
parent | de17f87d87f5964483e2abbae8169beff19a89f8 (diff) | |
download | SMAPI-98fa9f03891e3dc487bee6dcb3756e6251c67aef.tar.gz SMAPI-98fa9f03891e3dc487bee6dcb3756e6251c67aef.tar.bz2 SMAPI-98fa9f03891e3dc487bee6dcb3756e6251c67aef.zip |
update for Stardew Valley 1.3.0.5 (#453)
Diffstat (limited to 'src/SMAPI')
-rw-r--r-- | src/SMAPI/Constants.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/Events/EventArgsGameLocationsChanged.cs | 6 | ||||
-rw-r--r-- | src/SMAPI/Events/EventArgsLocationObjectsChanged.cs | 1 | ||||
-rw-r--r-- | src/SMAPI/Framework/GameVersion.cs | 24 |
4 files changed, 21 insertions, 12 deletions
diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 011762fb..d91fa5fb 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -47,7 +47,7 @@ namespace StardewModdingAPI /// <summary>The minimum supported version of Stardew Valley.</summary> public static ISemanticVersion MinimumGameVersion { get; } = #if STARDEW_VALLEY_1_3 - new GameVersion("1.3.0.2"); + new GameVersion("1.3.0.4"); #else new SemanticVersion("1.2.33"); #endif diff --git a/src/SMAPI/Events/EventArgsGameLocationsChanged.cs b/src/SMAPI/Events/EventArgsGameLocationsChanged.cs index fb8c821e..78ba38fa 100644 --- a/src/SMAPI/Events/EventArgsGameLocationsChanged.cs +++ b/src/SMAPI/Events/EventArgsGameLocationsChanged.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using StardewValley; @@ -11,7 +11,7 @@ namespace StardewModdingAPI.Events ** Accessors *********/ /// <summary>The current list of game locations.</summary> - public List<GameLocation> NewLocations { get; } + public IList<GameLocation> NewLocations { get; } /********* @@ -19,7 +19,7 @@ namespace StardewModdingAPI.Events *********/ /// <summary>Construct an instance.</summary> /// <param name="newLocations">The current list of game locations.</param> - public EventArgsGameLocationsChanged(List<GameLocation> newLocations) + public EventArgsGameLocationsChanged(IList<GameLocation> newLocations) { this.NewLocations = newLocations; } diff --git a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs index de3c31ea..180e9d78 100644 --- a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs +++ b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs @@ -1,6 +1,7 @@ using System; using Microsoft.Xna.Framework; #if STARDEW_VALLEY_1_3 +using System.Collections.Generic; using Netcode; #else using StardewValley; diff --git a/src/SMAPI/Framework/GameVersion.cs b/src/SMAPI/Framework/GameVersion.cs index c347ffba..e5022212 100644 --- a/src/SMAPI/Framework/GameVersion.cs +++ b/src/SMAPI/Framework/GameVersion.cs @@ -23,9 +23,7 @@ namespace StardewModdingAPI.Framework ["1.07"] = "1.0.7", ["1.07a"] = "1.0.8-prerelease1", ["1.08"] = "1.0.8", - ["1.11"] = "1.1.1", - ["1.3.0.1"] = "1.13-alpha.1", - ["1.3.0.2"] = "1.13-alpha.2" + ["1.11"] = "1.1.1" }; @@ -51,21 +49,31 @@ namespace StardewModdingAPI.Framework /// <param name="gameVersion">The game version string.</param> private static string GetSemanticVersionString(string gameVersion) { +#if STARDEW_VALLEY_1_3 + if(gameVersion.StartsWith("1.3.0.")) + return new SemanticVersion(1, 3, 0, "alpha." + gameVersion.Substring("1.3.0.".Length)).ToString(); +#endif + return GameVersion.VersionMap.TryGetValue(gameVersion, out string semanticVersion) ? semanticVersion : gameVersion; } - /// <summary>Convert a game version string to a semantic version string.</summary> - /// <param name="gameVersion">The game version string.</param> - private static string GetGameVersionString(string gameVersion) + /// <summary>Convert a semantic version string to the equivalent game version string.</summary> + /// <param name="semanticVersion">The semantic version string.</param> + private static string GetGameVersionString(string semanticVersion) { + #if STARDEW_VALLEY_1_3 + if(semanticVersion.StartsWith("1.3-alpha.")) + return "1.3.0." + semanticVersion.Substring("1.3-alpha.".Length); + #endif + foreach (var mapping in GameVersion.VersionMap) { - if (mapping.Value.Equals(gameVersion, StringComparison.InvariantCultureIgnoreCase)) + if (mapping.Value.Equals(semanticVersion, StringComparison.InvariantCultureIgnoreCase)) return mapping.Key; } - return gameVersion; + return semanticVersion; } } } |