summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Content/AssetDataForDictionary.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-11-24 13:49:30 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-11-24 13:49:30 -0500
commita3f21685049cabf2d824c8060dc0b1de47e9449e (patch)
treead9add30e9da2a50e0ea0245f1546b7378f0d282 /src/SMAPI/Framework/Content/AssetDataForDictionary.cs
parent6521df7b131924835eb797251c1e956fae0d6e13 (diff)
parent277bf082675b98b95bf6184fe3c7a45b969c7ac2 (diff)
downloadSMAPI-a3f21685049cabf2d824c8060dc0b1de47e9449e.tar.gz
SMAPI-a3f21685049cabf2d824c8060dc0b1de47e9449e.tar.bz2
SMAPI-a3f21685049cabf2d824c8060dc0b1de47e9449e.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/Content/AssetDataForDictionary.cs')
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForDictionary.cs43
1 files changed, 5 insertions, 38 deletions
diff --git a/src/SMAPI/Framework/Content/AssetDataForDictionary.cs b/src/SMAPI/Framework/Content/AssetDataForDictionary.cs
index 11a2564c..26cbff5a 100644
--- a/src/SMAPI/Framework/Content/AssetDataForDictionary.cs
+++ b/src/SMAPI/Framework/Content/AssetDataForDictionary.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
namespace StardewModdingAPI.Framework.Content
{
@@ -11,44 +10,12 @@ namespace StardewModdingAPI.Framework.Content
** Public methods
*********/
/// <summary>Construct an instance.</summary>
- /// <param name="locale">The content's locale code, if the content is localised.</param>
- /// <param name="assetName">The normalised asset name being read.</param>
+ /// <param name="locale">The content's locale code, if the content is localized.</param>
+ /// <param name="assetName">The normalized asset name being read.</param>
/// <param name="data">The content data being read.</param>
- /// <param name="getNormalisedPath">Normalises an asset key to match the cache key.</param>
+ /// <param name="getNormalizedPath">Normalizes an asset key to match the cache key.</param>
/// <param name="onDataReplaced">A callback to invoke when the data is replaced (if any).</param>
- public AssetDataForDictionary(string locale, string assetName, IDictionary<TKey, TValue> data, Func<string, string> getNormalisedPath, Action<IDictionary<TKey, TValue>> onDataReplaced)
- : base(locale, assetName, data, getNormalisedPath, onDataReplaced) { }
-
-#if !SMAPI_3_0_STRICT
- /// <summary>Add or replace an entry in the dictionary.</summary>
- /// <param name="key">The entry key.</param>
- /// <param name="value">The entry value.</param>
- [Obsolete("Access " + nameof(AssetData<IDictionary<TKey, TValue>>.Data) + "field directly.")]
- public void Set(TKey key, TValue value)
- {
- SCore.DeprecationManager.Warn($"AssetDataForDictionary.{nameof(Set)}", "2.10", DeprecationLevel.PendingRemoval);
- this.Data[key] = value;
- }
-
- /// <summary>Add or replace an entry in the dictionary.</summary>
- /// <param name="key">The entry key.</param>
- /// <param name="value">A callback which accepts the current value and returns the new value.</param>
- [Obsolete("Access " + nameof(AssetData<IDictionary<TKey, TValue>>.Data) + "field directly.")]
- public void Set(TKey key, Func<TValue, TValue> value)
- {
- SCore.DeprecationManager.Warn($"AssetDataForDictionary.{nameof(Set)}", "2.10", DeprecationLevel.PendingRemoval);
- this.Data[key] = value(this.Data[key]);
- }
-
- /// <summary>Dynamically replace values in the dictionary.</summary>
- /// <param name="replacer">A lambda which takes the current key and value for an entry, and returns the new value.</param>
- [Obsolete("Access " + nameof(AssetData<IDictionary<TKey, TValue>>.Data) + "field directly.")]
- public void Set(Func<TKey, TValue, TValue> replacer)
- {
- SCore.DeprecationManager.Warn($"AssetDataForDictionary.{nameof(Set)}", "2.10", DeprecationLevel.PendingRemoval);
- foreach (var pair in this.Data.ToArray())
- this.Data[pair.Key] = replacer(pair.Key, pair.Value);
- }
-#endif
+ public AssetDataForDictionary(string locale, string assetName, IDictionary<TKey, TValue> data, Func<string, string> getNormalizedPath, Action<IDictionary<TKey, TValue>> onDataReplaced)
+ : base(locale, assetName, data, getNormalizedPath, onDataReplaced) { }
}
}