Beispiel #1
0
        private void switchCards(ref List <card> deck, int cardIndexFrom, int cardIndexTo)
        {
            int deckCount = deck.Count;

            try
            {
                card tempn = Deck.ElementAt(cardIndexFrom);
                Deck.RemoveAt(cardIndexFrom);
                card tempk = Deck.ElementAt(cardIndexTo);
                Deck.RemoveAt(cardIndexTo);
                Deck.Insert(deckCount - 2, tempk);
                Deck.Insert(deckCount - 1, tempn);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }
        }
Beispiel #2
0
 public void addCard(card Card)
 {
     Deck.Insert(Deck.Count, Card);
 }