summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Content/AssetOperationGroup.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-03-22 23:00:18 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-03-22 23:00:18 -0400
commitb07d2340a9a6da22ee0fd95f2c6ccca3939cb7ab (patch)
treec61a7108ff66071b9b6feb5446c6bd3e14ba8182 /src/SMAPI/Framework/Content/AssetOperationGroup.cs
parentd3fbdf484a4d90365a55fb5058d75a8623f17d0f (diff)
downloadSMAPI-b07d2340a9a6da22ee0fd95f2c6ccca3939cb7ab.tar.gz
SMAPI-b07d2340a9a6da22ee0fd95f2c6ccca3939cb7ab.tar.bz2
SMAPI-b07d2340a9a6da22ee0fd95f2c6ccca3939cb7ab.zip
encapsulate & cache asset operation groups (#766)
This is needed for the upcoming Stardew Valley 1.6 to avoid duplicate checks between DoesAssetExist and Load calls, and to make sure the answer doesn't change between them.
Diffstat (limited to 'src/SMAPI/Framework/Content/AssetOperationGroup.cs')
-rw-r--r--src/SMAPI/Framework/Content/AssetOperationGroup.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Content/AssetOperationGroup.cs b/src/SMAPI/Framework/Content/AssetOperationGroup.cs
new file mode 100644
index 00000000..a2fcb722
--- /dev/null
+++ b/src/SMAPI/Framework/Content/AssetOperationGroup.cs
@@ -0,0 +1,33 @@
+namespace StardewModdingAPI.Framework.Content
+{
+ /// <summary>A set of operations to apply to an asset for a given <see cref="IAssetEditor"/> or <see cref="IAssetLoader"/> implementation.</summary>
+ internal class AssetOperationGroup
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The mod applying the changes.</summary>
+ public IModMetadata Mod { get; }
+
+ /// <summary>The load operations to apply.</summary>
+ public AssetLoadOperation[] LoadOperations { get; }
+
+ /// <summary>The edit operations to apply.</summary>
+ public AssetEditOperation[] EditOperations { get; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ /// <param name="mod">The mod applying the changes.</param>
+ /// <param name="loadOperations">The load operations to apply.</param>
+ /// <param name="editOperations">The edit operations to apply.</param>
+ public AssetOperationGroup(IModMetadata mod, AssetLoadOperation[] loadOperations, AssetEditOperation[] editOperations)
+ {
+ this.Mod = mod;
+ this.LoadOperations = loadOperations;
+ this.EditOperations = editOperations;
+ }
+ }
+}