/// <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> private string ChooseCategoryName(ItemKey itemKey) { if (itemKey.ItemType == ItemType.Object) { var proto = GetItem(itemKey); var categoryName = proto.getCategoryName(); return(String.IsNullOrEmpty(categoryName) ? "Miscellaneous" : categoryName); } else { return(Enum.GetName(typeof(ItemType), itemKey.ItemType)); } }
/// <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) => BlacklistedItemKeys.Contains(itemKey);
/// <summary> /// Return whether this chest accepts the given kind of item. /// </summary> public bool Accepts(ItemKey itemKey) { return(ItemsEnabled.Contains(itemKey)); }
public DiscoveredItem(ItemType type, int index, Item item) { ItemKey = new ItemKey(type, index); Item = item; }
/// <summary> /// Check whether the repository contains an item corresponding to the /// given key. /// </summary> public bool HasItem(ItemKey itemKey) { return(PrototypeMap.ContainsKey(itemKey)); }
/// <summary> /// Retrieve the representative item corresponding to the given key. /// </summary> public Item GetItem(ItemKey itemKey) { return(PrototypeMap[itemKey]); }