コード例 #1
0
 public static List <Tinkering> FindTinkerings(ItemSlot slot, Character character, List <string> availableIds, CalculationsBase model)
 {
     return(AllTinkerings.FindAll(new Predicate <Tinkering>(
                                      delegate(Tinkering Tinkering)
     {
         return Tinkering.Id == 0 ||
         ((Tinkering.Slot == ItemSlot.None ||
           model.IsTinkeringRelevant(Tinkering, character) && (slot == ItemSlot.None || Tinkering.FitsInSlot(slot, character))) &&
          availableIds.Contains((-1 * (Tinkering.Id + ((int)AvailableItemIDModifiers.Tinkerings * (int)Tinkering.Slot))).ToString()));
     }
                                      )));
 }
コード例 #2
0
 public static List <Tinkering> FindTinkerings(ItemSlot slot, Character character, CalculationsBase model)
 {
     //List<ItemSlot> validSlots = new List<ItemSlot>();
     //if (slot != ItemSlot.MainHand)
     //    validSlots.Add(slot);
     //if (slot == ItemSlot.OffHand || slot == ItemSlot.MainHand || slot == ItemSlot.TwoHand)
     //    validSlots.Add(ItemSlot.OneHand);
     //if (slot == ItemSlot.MainHand)
     //    validSlots.Add(ItemSlot.TwoHand);
     return(AllTinkerings.FindAll(new Predicate <Tinkering>(
                                      delegate(Tinkering Tinkering)
     {
         return Tinkering.Slot == ItemSlot.None ||
         model.IsTinkeringRelevant(Tinkering, character) &&
         (slot == ItemSlot.None || Tinkering.FitsInSlot(slot, character));
     }
                                      )));
 }