From 59dd604cf2905adf5fce7e9bb7b97886891aae81 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 27 Oct 2017 03:18:48 -0400 Subject: rename TrainerMod to Console Commands to clarify purpose --- .../Framework/ItemData/ItemType.cs | 39 ++++++++++++++++++++ .../Framework/ItemData/SearchableItem.cs | 41 ++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/ItemType.cs create mode 100644 src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs (limited to 'src/SMAPI.Mods.ConsoleCommands/Framework/ItemData') diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/ItemType.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/ItemType.cs new file mode 100644 index 00000000..797d4650 --- /dev/null +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/ItemType.cs @@ -0,0 +1,39 @@ +namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.ItemData +{ + /// An item type that can be searched and added to the player through the console. + internal enum ItemType + { + /// A big craftable object in + BigCraftable, + + /// A item. + Boots, + + /// A fish item. + Fish, + + /// A flooring item. + Flooring, + + /// A item. + Furniture, + + /// A item. + Hat, + + /// Any object in (except rings). + Object, + + /// A item. + Ring, + + /// A tool. + Tool, + + /// A wall item. + Wallpaper, + + /// A or item. + Weapon + } +} diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs new file mode 100644 index 00000000..3eede413 --- /dev/null +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs @@ -0,0 +1,41 @@ +using StardewValley; + +namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.ItemData +{ + /// A game item with metadata. + internal class SearchableItem + { + /********* + ** Accessors + *********/ + /// The item type. + public ItemType Type { get; } + + /// The item instance. + public Item Item { get; } + + /// The item's unique ID for its type. + public int ID { get; } + + /// The item's default name. + public string Name => this.Item.Name; + + /// The item's display name for the current language. + public string DisplayName => this.Item.DisplayName; + + + /********* + ** Public methods + *********/ + /// Construct an instance. + /// The item type. + /// The unique ID (if different from the item's parent sheet index). + /// The item instance. + public SearchableItem(ItemType type, int id, Item item) + { + this.Type = type; + this.ID = id; + this.Item = item; + } + } +} -- cgit