예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <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);
예제 #3
0
 public Item GetItem(ItemKey itemKey) => Prototypes.ContainsKey(itemKey)
                                             ? Prototypes[itemKey]
                                             : itemKey.GetOne();
예제 #4
0
 public DiscoveredItem(ItemType type, int index, Item item)
 {
     ItemKey = new ItemKey(type, index);
     Item    = item;
 }