summaryrefslogtreecommitdiff
path: root/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-10-28 18:21:33 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-10-28 18:21:33 -0400
commit2831b1e75a4634214fd9ba4e95edcac91d9cf321 (patch)
tree537414a0137ff9d804039c66291aba16d4b6b89b /src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs
parent295c34d5cd03764099f2fb803113bd60361cb282 (diff)
downloadSMAPI-2831b1e75a4634214fd9ba4e95edcac91d9cf321.tar.gz
SMAPI-2831b1e75a4634214fd9ba4e95edcac91d9cf321.tar.bz2
SMAPI-2831b1e75a4634214fd9ba4e95edcac91d9cf321.zip
add SearchableItem copy constructor
This is for convenience in mods which copy this code; SMAPI itself doesn't use it.
Diffstat (limited to 'src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs')
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs
index 3675a963..72d01eb7 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs
@@ -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)