using StardewValley;
namespace TrainerMod.ItemData
{
/// An object that can be searched and added to the player's inventory through the console.
internal class SearchableObject : ISearchItem
{
/*********
** Properties
*********/
/// The underlying item.
private readonly Item Item;
/*********
** Accessors
*********/
/// Whether the item is valid.
public bool IsValid => this.Item != null && this.Item.Name != "Broken Item";
/// The item ID.
public int ID => this.Item.parentSheetIndex;
/// The item name.
public string Name => this.Item.Name;
/// The item type.
public ItemType Type => ItemType.Object;
/*********
** Accessors
*********/
/// Construct an instance.
/// The item ID.
public SearchableObject(int id)
{
try
{
this.Item = new Object(id, 1);
}
catch
{
// invalid
}
}
}
}