/// <summary> /// Decide what category name the given item key should belong to. /// </summary> /// <returns>The chosen category name.</returns> /// <param name="itemKey">The item key to categorize.</param> public string GetCategoryName(ItemKey itemKey) { // move scythe to tools if (itemKey.ItemType == ItemType.Weapon && itemKey.ObjectIndex == MeleeWeapon.scythe) { return("Tool"); } if (itemKey.ItemType != ItemType.Object) { return(itemKey.ItemType.ToString()); } var categoryName = GetItem(itemKey).getCategoryName(); return(string.IsNullOrEmpty(categoryName) ? "Miscellaneous" : categoryName); }
/// <summary> /// Check whether a given item key is blacklisted. /// </summary> /// <returns>Whether the key is blacklisted.</returns> /// <param name="itemKey">Item key to check.</param> public static bool Includes(ItemKey itemKey) => itemKey.ItemType == ItemType.BigCraftable || itemKey.ItemType == ItemType.Furniture || BlacklistedItemKeys.Contains(itemKey);
public Item GetItem(ItemKey itemKey) => Prototypes.ContainsKey(itemKey) ? Prototypes[itemKey] : itemKey.GetOne();
public DiscoveredItem(ItemType type, int index, Item item) { ItemKey = new ItemKey(type, index); Item = item; }