using System; using StardewModdingAPI.Events; namespace StardewModdingAPI.Framework.Content { /// An operation which provides the initial instance of an asset when it's requested from the content pipeline. internal class AssetLoadOperation { /********* ** Accessors *********/ /// The mod loading the asset. public IModMetadata Mod { get; } /// The content pack on whose behalf the asset is being loaded, if any. public IModMetadata? OnBehalfOf { get; } /// If there are multiple loads that apply to the same asset, the priority with which this one should be applied. public AssetLoadPriority Priority { get; } /// Load the initial value for an asset. public Func GetData { get; } /********* ** Public methods *********/ /// Construct an instance. /// The mod applying the edit. /// If there are multiple loads that apply to the same asset, the priority with which this one should be applied. /// The content pack on whose behalf the asset is being loaded, if any. /// Load the initial value for an asset. public AssetLoadOperation(IModMetadata mod, AssetLoadPriority priority, IModMetadata? onBehalfOf, Func getData) { this.Mod = mod; this.Priority = priority; this.OnBehalfOf = onBehalfOf; this.GetData = getData; } } }