From d47cf433f39ddfa77c7903bca676f725052a2592 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 8 Mar 2017 15:34:38 -0500 Subject: [PATCH] use consistent dict helper method naming (#173) --- .../Content/ContentEventHelperForDictionary.cs | 10 +++++----- .../IContentEventHelperForDictionary.cs | 10 +++++----- 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 data, Func getNormalisedPath) : base(locale, assetName, data, getNormalisedPath) { } - /// Add or replace an entry in the dictionary data. + /// Add or replace an entry in the dictionary. /// The entry key. /// The entry value. - public void SetEntry(TKey key, TValue value) + public void Set(TKey key, TValue value) { this.Data[key] = value; } - /// Add or replace an entry in the dictionary data. + /// Add or replace an entry in the dictionary. /// The entry key. /// A callback which accepts the current value and returns the new value. - public void SetEntry(TKey key, Func value) + public void Set(TKey key, Func value) { this.Data[key] = value(this.Data[key]); } /// Dynamically replace values in the dictionary. /// A lambda which takes the current key and value for an entry, and returns the new value. - public void Replace(Func replacer) + public void Set(Func 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 /// The expected asset path, relative to the game's content folder and without the .xnb extension or locale suffix (like 'Data\ObjectInformation'). bool IsAssetName(string path); - /// Add or replace an entry in the dictionary data. + /// Add or replace an entry in the dictionary. /// The entry key. /// The entry value. - void SetEntry(TKey key, TValue value); + void Set(TKey key, TValue value); - /// Add or replace an entry in the dictionary data. + /// Add or replace an entry in the dictionary. /// The entry key. /// A callback which accepts the current value and returns the new value. - void SetEntry(TKey key, Func value); + void Set(TKey key, Func value); /// Dynamically replace values in the dictionary. /// A lambda which takes the current key and value for an entry, and returns the new value. - void Replace(Func replacer); + void Set(Func replacer); /// 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. /// The new content value.