summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Framework/Content
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-07-01 23:13:43 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-07-01 23:13:43 -0400
commitf95c7e8d72014f8008886031cebf7b12aeb7ed46 (patch)
tree3833a0513c980854d66af1348cdf16140d34da95 /src/StardewModdingAPI/Framework/Content
parent600ef562861fe306390b78ee8f08036f0872e92c (diff)
downloadSMAPI-f95c7e8d72014f8008886031cebf7b12aeb7ed46.tar.gz
SMAPI-f95c7e8d72014f8008886031cebf7b12aeb7ed46.tar.bz2
SMAPI-f95c7e8d72014f8008886031cebf7b12aeb7ed46.zip
add support for asset loaders (#255)
Diffstat (limited to 'src/StardewModdingAPI/Framework/Content')
-rw-r--r--src/StardewModdingAPI/Framework/Content/AssetDataForObject.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Framework/Content/AssetDataForObject.cs b/src/StardewModdingAPI/Framework/Content/AssetDataForObject.cs
index af2f54ae..f30003e4 100644
--- a/src/StardewModdingAPI/Framework/Content/AssetDataForObject.cs
+++ b/src/StardewModdingAPI/Framework/Content/AssetDataForObject.cs
@@ -18,6 +18,13 @@ namespace StardewModdingAPI.Framework.Content
public AssetDataForObject(string locale, string assetName, object data, Func<string, string> getNormalisedPath)
: base(locale, assetName, data, getNormalisedPath) { }
+ /// <summary>Construct an instance.</summary>
+ /// <param name="info">The asset metadata.</param>
+ /// <param name="data">The content data being read.</param>
+ /// <param name="getNormalisedPath">Normalises an asset key to match the cache key.</param>
+ public AssetDataForObject(IAssetInfo info, object data, Func<string, string> getNormalisedPath)
+ : this(info.Locale, info.AssetName, data, getNormalisedPath) { }
+
/// <summary>Get a helper to manipulate the data as a dictionary.</summary>
/// <typeparam name="TKey">The expected dictionary key.</typeparam>
/// <typeparam name="TValue">The expected dictionary balue.</typeparam>