using System;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using xTile;
namespace StardewModdingAPI
{
/// Provides an API for loading content assets from the current mod's folder.
public interface IModContentHelper : IModLinked
{
/*********
** Public methods
*********/
/// Load content from the mod folder and return it. When loading a .png file, this must be called outside the game's draw loop.
/// The expected data type. The main supported types are , , , and data structures; other types may be supported by the game's content pipeline.
/// The local path to a content file relative to the mod folder.
/// The is empty or contains invalid characters.
/// The content asset couldn't be loaded (e.g. because it doesn't exist).
T Load(string relativePath)
where T : notnull;
/// Get the internal asset name which allows loading a mod file through any of the game's content managers. This can be used when passing asset names directly to the game (e.g. for map tilesheets), but should be avoided if you can use instead. This does not validate whether the asset exists.
/// The local path to a content file relative to the mod folder.
/// The is empty or contains invalid characters.
IAssetName GetInternalAssetName(string relativePath);
/// Get a patch helper for arbitrary data.
/// The data type.
/// The asset data.
/// The local path to the content file being edited relative to the mod folder. This is only used for tracking purposes and has no effect on the patch helper.
IAssetData GetPatchHelper(T data, string? relativePath = null)
where T : notnull;
}
}