diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-03-27 13:42:14 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-03-27 13:42:14 -0400 |
commit | 1d3c99cc25f6c0d504fd5e43ea71ef327b6e9066 (patch) | |
tree | a436d2e6abeeeae94df93fb4bf400664ca740b89 /src/SMAPI/Framework/Content | |
parent | d864f2ed775dfd5843b9e1cdd1da96ade5dd1068 (diff) | |
download | SMAPI-1d3c99cc25f6c0d504fd5e43ea71ef327b6e9066.tar.gz SMAPI-1d3c99cc25f6c0d504fd5e43ea71ef327b6e9066.tar.bz2 SMAPI-1d3c99cc25f6c0d504fd5e43ea71ef327b6e9066.zip |
split helper.Content API into game/mod content APIs
Diffstat (limited to 'src/SMAPI/Framework/Content')
-rw-r--r-- | src/SMAPI/Framework/Content/AssetName.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Content/AssetName.cs b/src/SMAPI/Framework/Content/AssetName.cs index 7ce0f8ee..a1d37b0b 100644 --- a/src/SMAPI/Framework/Content/AssetName.cs +++ b/src/SMAPI/Framework/Content/AssetName.cs @@ -101,6 +101,18 @@ namespace StardewModdingAPI.Framework.Content } /// <inheritdoc /> + public bool IsEquivalentTo(IAssetName assetName, bool useBaseName = false) + { + if (useBaseName) + return this.BaseName.Equals(assetName?.BaseName, StringComparison.OrdinalIgnoreCase); + + if (assetName is AssetName impl) + return this.ComparableName == impl?.ComparableName; + + return this.Name.Equals(assetName?.Name, StringComparison.OrdinalIgnoreCase); + } + + /// <inheritdoc /> public bool StartsWith(string prefix, bool allowPartialWord = true, bool allowSubfolder = true) { // asset keys never start with null |