add SearchableItem copy constructor

This is for convenience in mods which copy this code; SMAPI itself doesn't use it.
This commit is contained in:
Jesse Plamondon-Willard 2020-10-28 18:21:33 -04:00
parent 295c34d5cd
commit 2831b1e75a
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,16 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.ItemData
this.Item = createItem(this);
}
/// <summary>Construct an instance.</summary>
/// <param name="item">The item metadata to copy.</param>
public SearchableItem(SearchableItem item)
{
this.Type = item.Type;
this.ID = item.ID;
this.CreateItem = item.CreateItem;
this.Item = item.Item;
}
/// <summary>Get whether the item name contains a case-insensitive substring.</summary>
/// <param name="substring">The substring to find.</param>
public bool NameContains(string substring)