diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-06-29 01:01:57 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-06-29 01:01:57 -0400 |
commit | a0888e0ad1bf0ed38982d2aadf78c31d046b061b (patch) | |
tree | 030252503aef17214766dda8a7dbbb60fc4fe4a8 /src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs | |
parent | c9fedebaf3231a2d5a00a95ff1ffd3ac5dac4ae2 (diff) | |
download | SMAPI-a0888e0ad1bf0ed38982d2aadf78c31d046b061b.tar.gz SMAPI-a0888e0ad1bf0ed38982d2aadf78c31d046b061b.tar.bz2 SMAPI-a0888e0ad1bf0ed38982d2aadf78c31d046b061b.zip |
add optional extended metadata to mods API (#532)
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs')
-rw-r--r-- | src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs index 21c9cfca..82ac8837 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs @@ -86,6 +86,16 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData : version; } + /// <summary>Get the possible mod IDs.</summary> + public IEnumerable<string> GetIDs() + { + return this.FormerIDs + .Concat(new[] { this.ID }) + .Where(p => !string.IsNullOrWhiteSpace(p)) + .Select(p => p.Trim()) + .Distinct(); + } + /// <summary>Get a parsed representation of the <see cref="ModDataRecord.Fields"/> which match a given manifest.</summary> /// <param name="manifest">The manifest to match.</param> public ModDataRecordVersionedFields GetVersionedFields(IManifest manifest) |