diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-11 21:36:45 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-11 21:36:45 -0400 |
commit | bbe5983acdd082d2185a69e2ad37d659a298223d (patch) | |
tree | ad6fe68ebd0da25a832e9fad3832741dee50954f /src/SMAPI/Framework/Content | |
parent | 42a797a01240893e9a8e645253a269087b2d178d (diff) | |
download | SMAPI-bbe5983acdd082d2185a69e2ad37d659a298223d.tar.gz SMAPI-bbe5983acdd082d2185a69e2ad37d659a298223d.tar.bz2 SMAPI-bbe5983acdd082d2185a69e2ad37d659a298223d.zip |
rewrite asset operations to reduce allocations
• When raising AssetRequested, SMAPI now creates a single event args model and reuses it for each handler.
• There's now a single AssetOperationGroup per asset, which tracks the loaders/editors registered by every mod for that asset.
• The operation group's loader/editor lists are now used directly instead of querying them.
Diffstat (limited to 'src/SMAPI/Framework/Content')
-rw-r--r-- | src/SMAPI/Framework/Content/AssetOperationGroup.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/SMAPI/Framework/Content/AssetOperationGroup.cs b/src/SMAPI/Framework/Content/AssetOperationGroup.cs index 1566a8f0..11767d39 100644 --- a/src/SMAPI/Framework/Content/AssetOperationGroup.cs +++ b/src/SMAPI/Framework/Content/AssetOperationGroup.cs @@ -1,8 +1,9 @@ +using System.Collections.Generic; + 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> - /// <param name="Mod">The mod applying the changes.</param> + /// <summary>A set of operations to apply to an asset.</summary> /// <param name="LoadOperations">The load operations to apply.</param> /// <param name="EditOperations">The edit operations to apply.</param> - internal record AssetOperationGroup(IModMetadata Mod, AssetLoadOperation[] LoadOperations, AssetEditOperation[] EditOperations); + internal record AssetOperationGroup(List<AssetLoadOperation> LoadOperations, List<AssetEditOperation> EditOperations); } |