public DeckEditorModel() { MainDeck = new DeckZoneModel(); SideDeck = new DeckZoneModel(); SampleHand = new DeckZoneModel(); CurrentZone = Zone.Main; }
private static int getInsertionIndex(Card card, Card at, DeckZoneModel zoneModel) { int index = zoneModel.CardsIds.IndexOf((at ?? card).Id); if (index < 0) { return(zoneModel.CardsIds.Count); } return(index); }
private static int countNonTokens(CardRepository repo, DeckZoneModel zone) { if (repo.IsLoadingComplete.Signaled) { return(zone.CountById .Where(_ => !repo.CardsById.TryGet(_.Key)?.IsToken != false) .Sum(_ => _.Value)); } return(zone.CountById.Values.Sum()); }
public static IEnumerable <string> NamesakeIds(this DeckZoneModel zone, Card card) => zone.CardsIds.Where(id => id == card.Id || card.NamesakeIds.Contains(id));
public static bool Contains(this DeckZoneModel zone, Card c) => zone.CountById.ContainsKey(c.Id);