Exemple #1
0
 private static bool MeetsFilter(Item item, ItemFilter filter)
 {
     return(filter switch
     {
         ItemFilter.Ingredient => ItemHelper.IsIngredient(item),
         ItemFilter.Craftable => CraftHelper.CanCraft(item),
         ItemFilter.Sellable => ItemHelper.CanSell(item),
         ItemFilter.Buyable => ItemHelper.CanBuy(item),
         ItemFilter.Usable => item.Usage != null,
         ItemFilter.Tradable => ItemHelper.CanTrade(item),
         ItemFilter.Unique => ItemHelper.IsUnique(item),
         _ => false
     });