diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-01 18:16:09 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-01 18:16:09 -0400 |
commit | c8ad50dad1d706a1901798f9396f6becfea36c0e (patch) | |
tree | 28bd818a5db39ec5ece1bd141a28de955950463b /src/SMAPI/Framework/Content/AssetEditOperation.cs | |
parent | 451b70953ff4c0b1b27ae0de203ad99379b45b2a (diff) | |
parent | f78093bdb58d477b400cde3f19b70ffd6ddf833d (diff) | |
download | SMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.tar.gz SMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.tar.bz2 SMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/Content/AssetEditOperation.cs')
-rw-r--r-- | src/SMAPI/Framework/Content/AssetEditOperation.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Content/AssetEditOperation.cs b/src/SMAPI/Framework/Content/AssetEditOperation.cs new file mode 100644 index 00000000..464948b0 --- /dev/null +++ b/src/SMAPI/Framework/Content/AssetEditOperation.cs @@ -0,0 +1,41 @@ +using System; +using StardewModdingAPI.Events; + +namespace StardewModdingAPI.Framework.Content +{ + /// <summary>An edit to apply to an asset when it's requested from the content pipeline.</summary> + internal class AssetEditOperation + { + /********* + ** Accessors + *********/ + /// <summary>The mod applying the edit.</summary> + public IModMetadata Mod { get; } + + /// <summary>If there are multiple edits that apply to the same asset, the priority with which this one should be applied.</summary> + public AssetEditPriority Priority { get; } + + /// <summary>The content pack on whose behalf the edit is being applied, if any.</summary> + public IModMetadata? OnBehalfOf { get; } + + /// <summary>Apply the edit to an asset.</summary> + public Action<IAssetData> ApplyEdit { get; } + + + /********* + ** Public methods + *********/ + /// <summary>Construct an instance.</summary> + /// <param name="mod">The mod applying the edit.</param> + /// <param name="priority">If there are multiple edits that apply to the same asset, the priority with which this one should be applied.</param> + /// <param name="onBehalfOf">The content pack on whose behalf the edit is being applied, if any.</param> + /// <param name="applyEdit">Apply the edit to an asset.</param> + public AssetEditOperation(IModMetadata mod, AssetEditPriority priority, IModMetadata? onBehalfOf, Action<IAssetData> applyEdit) + { + this.Mod = mod; + this.Priority = priority; + this.OnBehalfOf = onBehalfOf; + this.ApplyEdit = applyEdit; + } + } +} |