Exemplo n.º 1
0
        public DeckEditorModel()
        {
            MainDeck   = new DeckZoneModel();
            SideDeck   = new DeckZoneModel();
            SampleHand = new DeckZoneModel();

            CurrentZone = Zone.Main;
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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());
        }
Exemplo n.º 4
0
 public static IEnumerable <string> NamesakeIds(this DeckZoneModel zone, Card card) =>
 zone.CardsIds.Where(id => id == card.Id || card.NamesakeIds.Contains(id));
Exemplo n.º 5
0
 public static bool Contains(this DeckZoneModel zone, Card c) =>
 zone.CountById.ContainsKey(c.Id);