예제 #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>
 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));
     }
 }
예제 #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) => BlacklistedItemKeys.Contains(itemKey);
예제 #3
0
 /// <summary>
 /// Return whether this chest accepts the given kind of item.
 /// </summary>
 public bool Accepts(ItemKey itemKey)
 {
     return(ItemsEnabled.Contains(itemKey));
 }
예제 #4
0
 public DiscoveredItem(ItemType type, int index, Item item)
 {
     ItemKey = new ItemKey(type, index);
     Item    = item;
 }
예제 #5
0
 /// <summary>
 /// Check whether the repository contains an item corresponding to the
 /// given key.
 /// </summary>
 public bool HasItem(ItemKey itemKey)
 {
     return(PrototypeMap.ContainsKey(itemKey));
 }
예제 #6
0
 /// <summary>
 /// Retrieve the representative item corresponding to the given key.
 /// </summary>
 public Item GetItem(ItemKey itemKey)
 {
     return(PrototypeMap[itemKey]);
 }