summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-03-08 15:34:38 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-03-08 15:34:38 -0500
commitd47cf433f39ddfa77c7903bca676f725052a2592 (patch)
tree50c9385d9c5ef89915966a9fb799563f7ebf51dc /src
parent28c78e8f25a0d062d0dda49bc089ebebef8bfa20 (diff)
downloadSMAPI-d47cf433f39ddfa77c7903bca676f725052a2592.tar.gz
SMAPI-d47cf433f39ddfa77c7903bca676f725052a2592.tar.bz2
SMAPI-d47cf433f39ddfa77c7903bca676f725052a2592.zip
use consistent dict helper method naming (#173)
Diffstat (limited to 'src')
-rw-r--r--src/StardewModdingAPI/Framework/Content/ContentEventHelperForDictionary.cs10
-rw-r--r--src/StardewModdingAPI/IContentEventHelperForDictionary.cs10
2 files changed, 10 insertions, 10 deletions
diff --git a/src/StardewModdingAPI/Framework/Content/ContentEventHelperForDictionary.cs b/src/StardewModdingAPI/Framework/Content/ContentEventHelperForDictionary.cs
index 9bfc16d8..8a8a4845 100644
--- a/src/StardewModdingAPI/Framework/Content/ContentEventHelperForDictionary.cs
+++ b/src/StardewModdingAPI/Framework/Content/ContentEventHelperForDictionary.cs
@@ -18,25 +18,25 @@ namespace StardewModdingAPI.Framework.Content
public ContentEventHelperForDictionary(string locale, string assetName, IDictionary<TKey, TValue> data, Func<string, string> getNormalisedPath)
: base(locale, assetName, data, getNormalisedPath) { }
- /// <summary>Add or replace an entry in the dictionary data.</summary>
+ /// <summary>Add or replace an entry in the dictionary.</summary>
/// <param name="key">The entry key.</param>
/// <param name="value">The entry value.</param>
- public void SetEntry(TKey key, TValue value)
+ public void Set(TKey key, TValue value)
{
this.Data[key] = value;
}
- /// <summary>Add or replace an entry in the dictionary data.</summary>
+ /// <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>
- public void SetEntry(TKey key, Func<TValue, TValue> value)
+ public void Set(TKey key, Func<TValue, TValue> value)
{
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>
- public void Replace(Func<TKey, TValue, TValue> replacer)
+ public void Set(Func<TKey, TValue, TValue> replacer)
{
foreach (var pair in this.Data.ToArray())
this.Data[pair.Key] = replacer(pair.Key, pair.Value);
diff --git a/src/StardewModdingAPI/IContentEventHelperForDictionary.cs b/src/StardewModdingAPI/IContentEventHelperForDictionary.cs
index 34796d5c..34e69d42 100644
--- a/src/StardewModdingAPI/IContentEventHelperForDictionary.cs
+++ b/src/StardewModdingAPI/IContentEventHelperForDictionary.cs
@@ -26,19 +26,19 @@ namespace StardewModdingAPI
/// <param name="path">The expected asset path, relative to the game's content folder and without the .xnb extension or locale suffix (like 'Data\ObjectInformation').</param>
bool IsAssetName(string path);
- /// <summary>Add or replace an entry in the dictionary data.</summary>
+ /// <summary>Add or replace an entry in the dictionary.</summary>
/// <param name="key">The entry key.</param>
/// <param name="value">The entry value.</param>
- void SetEntry(TKey key, TValue value);
+ void Set(TKey key, TValue value);
- /// <summary>Add or replace an entry in the dictionary data.</summary>
+ /// <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>
- void SetEntry(TKey key, Func<TValue, TValue> value);
+ void Set(TKey key, Func<TValue, TValue> value);
/// <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>
- void Replace(Func<TKey, TValue, TValue> replacer);
+ void Set(Func<TKey, TValue, TValue> replacer);
/// <summary>Replace the entire content value with the given value. This is generally not recommended, since it may break compatibility with other mods or different versions of the game.</summary>
/// <param name="value">The new content value.</param>