public static T GetDistinctEnchantment <T>(this IEnchanted enchanted, bool includeEquipped = true) where T : IEnchantmentValue, IEnchantmentHook, IDistinctEnchantment { var enchantments = enchanted is Mobile mobile && includeEquipped ? GetAllEnchantmentsOfType <T>(mobile) : enchanted.Enchantments.Values.Values.OfType <T>(); return(enchantments.OrderByDescending(x => x).FirstOrDefault()); }
public static void FireHook(this IEnchanted enchanted, Action <IEnchantmentHook> action) { Dispatcher(enchanted.Enchantments.Values.Values, action); }
public static void FireHook(this IEnchanted enchanted, Expression <Action <IEnchantmentHook> > action) { Fire(enchanted.Enchantments.Values.Values, action); }