public void SetupNewSolitaireGame()
        {
            DrawPile.Cards.Clear();
            FaceUpPile.Cards.Clear();
            MyHand.Cards.Clear();
            foreach (AcePile acePile in AcePiles)
                acePile.Cards.Clear();
            foreach (PlayPile playPile in PlayPiles)
                playPile.Cards.Clear();

            Deck deck = new Deck();

            deck.FillDeck();
            deck.Shuffle();

            foreach (Card card in deck.Cards)
            {
                card.LoadContent(Content);
            }

            for (int i = 0; i < PlayPiles.Count; i++)
            {
                for (int j = 0; i >= j; j++)
                {
                    PlayPiles[i].AddCard(deck.TakeTopCard());
                }
                PlayPiles[i].Cards[i].isFaceDown = false;
            }

            for (int i = 0; deck.Cards.Count > 0; i++)
            {
                Card c = deck.TakeTopCard();
                DrawPile.AddCard(c);
            }

            //sound.Shuffle();
        }
Exemple #2
0
 public void AddFromDeck(Card card, Deck FromDeck)
 {
     LastDeck = FromDeck;
     base.AddCard(card);
 }