diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-10-02 16:40:23 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-10-02 16:40:23 -0400 |
commit | b5c88d87d2cb1739585651e02513fef73dfc0e27 (patch) | |
tree | cd8a2afda5ee8cccc806574613f6de4073970c7a /src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs | |
parent | 0888f71a5c7fe2bbf815409a70834ac85013c7f8 (diff) | |
download | SMAPI-b5c88d87d2cb1739585651e02513fef73dfc0e27.tar.gz SMAPI-b5c88d87d2cb1739585651e02513fef73dfc0e27.tar.bz2 SMAPI-b5c88d87d2cb1739585651e02513fef73dfc0e27.zip |
add support for unified mod data overrides on the wiki
Diffstat (limited to 'src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs')
-rw-r--r-- | src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs b/src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs index 7e4d0220..077c0361 100644 --- a/src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs +++ b/src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs @@ -89,6 +89,16 @@ namespace StardewModdingAPI.Toolkit.Framework.UpdateData return new UpdateKey(raw, site, id, subkey); } + /// <summary>Parse a raw update key if it's valid.</summary> + /// <param name="raw">The raw update key to parse.</param> + /// <param name="parsed">The parsed update key, if valid.</param> + /// <returns>Returns whether the update key was successfully parsed.</returns> + public static bool TryParse(string raw, out UpdateKey parsed) + { + parsed = UpdateKey.Parse(raw); + return parsed.LooksValid; + } + /// <summary>Get a string that represents the current object.</summary> public override string ToString() { |