using System.Collections.Generic;
namespace StardewModdingAPI.Framework.ModHelpers
{
/// Provides metadata about installed mods.
internal class ModRegistryHelper : BaseHelper, IModRegistry
{
/*********
** Properties
*********/
/// The underlying mod registry.
private readonly ModRegistry Registry;
/*********
** Public methods
*********/
/// Construct an instance.
/// The unique ID of the relevant mod.
/// The underlying mod registry.
public ModRegistryHelper(string modID, ModRegistry registry)
: base(modID)
{
this.Registry = registry;
}
/// Get metadata for all loaded mods.
public IEnumerable GetAll()
{
return this.Registry.GetAll();
}
/// Get metadata for a loaded mod.
/// The mod's unique ID.
/// Returns the matching mod's metadata, or null if not found.
public IManifest Get(string uniqueID)
{
return this.Registry.Get(uniqueID);
}
/// Get whether a mod has been loaded.
/// The mod's unique ID.
public bool IsLoaded(string uniqueID)
{
return this.Registry.IsLoaded(uniqueID);
}
}
}