-
-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move IEditAssetMigrator logic into BaseRuntimeMigration
- Loading branch information
1 parent
06f3670
commit 4caad1c
Showing
5 changed files
with
80 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
ContentPatcher/Framework/Migrations/Internal/IEditAssetMigrator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using ContentPatcher.Framework.Conditions; | ||
using ContentPatcher.Framework.Patches; | ||
using StardewModdingAPI; | ||
|
||
namespace ContentPatcher.Framework.Migrations.Internal | ||
{ | ||
/// <summary>A migrator which applies older <see cref="PatchType.EditData"/> patches to a newer asset or format.</summary> | ||
internal interface IEditAssetMigrator | ||
{ | ||
/// <summary>Get whether this migration applies to a patch.</summary> | ||
/// <param name="assetName">The asset name to check. If the asset was redirected, this is the asset name before redirection.</param> | ||
bool AppliesTo(IAssetName assetName); | ||
|
||
/// <inheritdoc cref="IRuntimeMigration.RedirectTarget" /> | ||
IAssetName? RedirectTarget(IAssetName assetName, IPatch patch); | ||
|
||
/// <inheritdoc cref="IRuntimeMigration.TryApplyLoadPatch{T}" /> | ||
bool TryApplyLoadPatch<T>(LoadPatch patch, IAssetName assetName, [NotNullWhen(true)] ref T? asset, out string? error); | ||
|
||
/// <inheritdoc cref="IRuntimeMigration.TryApplyEditPatch{T}" /> | ||
bool TryApplyEditPatch<T>(EditDataPatch patch, IAssetData asset, out string? error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters