public virtual bool Update(Card card) { if (card.Type == "Spell") { HearthDb.Cards.All.TryGetValue(card.Id, out DbCard dbCard); if (dbCard?.SpellSchool > 0) { if (SchoolList.ContainsKey(dbCard.SpellSchool)) { SchoolList[dbCard.SpellSchool] = card.Clone() as Card; } else { SchoolList.Add(dbCard.SpellSchool, card.Clone() as Card); } Cards.Update(SchoolList.Values.ToList(), true); Visibility = Visibility.Visible; return(true); } } return(false); }
public virtual bool Update(Card card) { CardLists[0].Add(card.Clone() as Card); Views[0].Cards.Update(CardLists[0], false); Visibility = Visibility.Visible; return(true); }
public virtual bool Update(Card card) { Cards.Update(new List <Card> { card.Clone() as Card }, false); Visibility = Visibility.Visible; return(true); }
public bool Update(Card card, bool isSpell = false) { if (card.Type != "Minion" && !isSpell) { return(false); } // Increment var match = Cards.FirstOrDefault(c => c.Name == card.Name); if (match != null) { match.Count++; } else { Cards.Add(card.Clone() as Card); } View.Update(Cards, false); Visibility = Visibility.Visible; return(true); }