using System;
using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Content
{
/// An edit to apply to an asset when it's requested from the content pipeline.
internal class AssetEditOperation
{
/*********
** Accessors
*********/
/// The mod applying the edit.
public IModMetadata Mod { get; }
/// If there are multiple edits that apply to the same asset, the priority with which this one should be applied.
public AssetEditPriority Priority { get; }
/// The content pack on whose behalf the edit is being applied, if any.
public IModMetadata OnBehalfOf { get; }
/// Apply the edit to an asset.
public Action ApplyEdit { get; }
/*********
** Public methods
*********/
/// Construct an instance.
/// The mod applying the edit.
/// If there are multiple edits that apply to the same asset, the priority with which this one should be applied.
/// The content pack on whose behalf the edit is being applied, if any.
/// Apply the edit to an asset.
public AssetEditOperation(IModMetadata mod, AssetEditPriority priority, IModMetadata onBehalfOf, Action applyEdit)
{
this.Mod = mod;
this.Priority = priority;
this.OnBehalfOf = onBehalfOf;
this.ApplyEdit = applyEdit;
}
}
}