示例#1
0
        public void OnSpellCast(SpellDeliverable spell)
        {
            var orders = SaveData.Value
                         .Where(e => e.Contents is Order)
                         .Select(e => e.Contents as Order);

            var incompleteOrderInvoices = orders
                                          .Where(o => o.State == OrderState.InProgress)
                                          .Select(o => o.Invoice);

            foreach (Invoice invoice in incompleteOrderInvoices)
            {
                var spells = invoice.LineItems.Where(li => li is SpellDeliverable).Select(li => li as SpellDeliverable).ToList();

                if (spells.Contains(spell))
                {
                    Alert.Instance.ShowMessage($"WitchWatch: spell {spells.IndexOf(spell) + 1} was cast for order #{invoice.OrderNumber}");
                }
            }
        }
示例#2
0
 public bool Equals(SpellDeliverable other)
 {
     return(base.Equals(other) && TargetName.Equals(other.TargetName, StringComparison.InvariantCultureIgnoreCase));
 }