using System; namespace StardewModdingAPI { /// Encapsulates access and changes to content being read from a data file. public interface IContentEventHelper { /********* ** Accessors *********/ /// The normalised asset path being read. The format may change between platforms; see to compare with a known path. string Path { get; } /// The content data being read. object Data { get; } /********* ** Public methods *********/ /// Get whether the asset path being loaded matches a given path after normalisation. /// The expected asset path, relative to the game folder and without the .xnb extension (like 'Data\ObjectInformation'). /// Whether to match a localised version of the asset file (like 'Data\ObjectInformation.ja-JP'). bool IsPath(string path, bool matchLocalisedVersion = true); /// Get the data as a given type. /// The expected data type. /// The data can't be converted to . TData GetData(); /// Add or replace an entry in the dictionary data. /// The entry key type. /// The entry value type. /// The entry key. /// The entry value. /// The content being read isn't a dictionary. void SetDictionaryEntry(TKey key, TValue value); /// Add or replace an entry in the dictionary data. /// The entry key type. /// The entry value type. /// The entry key. /// A callback which accepts the current value and returns the new value. /// The content being read isn't a dictionary. void SetDictionaryEntry(TKey key, Func value); /// 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. /// The is null. /// The 's type is not compatible with the loaded asset's type. void ReplaceWith(object value); } }