Example #1
0
 public void updateDeck(Models.CollectionDeck deck)
 {
     for (int i = 0; i < Decks.Count; i++)
     {
         if (Decks[i].DeckID == deck.DeckID)
         {
             Decks[i] = deck.Clone();
             break;
         }
     }
 }
Example #2
0
        public string collectionDeckToStringArgument(Models.CollectionDeck deck)
        {
            List <string> arguments;

            arguments = new List <string>();

            foreach (Models.CollectionDeckItem cdi in deck.CardList)
            {
                arguments.Add(string.Format("{0}&{1}", cdi.Card.ID, cdi.Count));
            }

            return(String.Join(";", arguments.ToArray()));
        }
Example #3
0
        // whenever you select a deck

        private void populateDeckContents(int id)
        {
            Models.CollectionDeck deck;

            stackDeckContents.Children.Clear();
            listDeckContentGUI.Clear();
            deck = ctrl.getDeckByID(id);

            this.deck = deck.Clone();

            if (deck != null)
            {
                foreach (Models.CollectionDeckItem cdi in deck.CardList)
                {
                    Models.DeckItemGUIModel cguim = new Models.DeckItemGUIModel(cdi, this);
                    listDeckContentGUI.Add(cguim);
                    stackDeckContents.Children.Add(cguim.Border);
                }
            }
        }