示例#1
0
        private void AddDeck()
        {
            for (int i = 1; i <= 4; i++)
            {
                for (int l = 2; l <= 10; l++)
                {
                    Card karta = new Card(l.ToString());
                    Cards.Add(karta);
                }

                Card a = new Card("A"); Card k = new Card("K"); Card q = new Card("Q"); Card j = new Card("J");
                Cards.Add(a); Cards.Add(k); Cards.Add(q); Cards.Add(j);
            }
        }
        public void DrawTwoCardsToAll(GameDeck gameDeck, IPlayer player)
        {
            Card card;
            Hand playerHand = player.Hands[0];

            for (int i = 0; i < 2; i++)
            {
                card = DrawCard(gameDeck);
                Cards.Add(DrawCard(gameDeck));
                playerHand.Cards.Add(card);
            }

            Cards[1].Flag = Visibility.Invisible;
            Points       += Cards[0].GetPoints(Points);
        }
示例#3
0
        public void Shuffle()
        {
            Init();
            MoveCardsToShuffler();

            int    cardsInDeck = Shuffler.Count;
            Random rnd         = new Random();

            while (cardsInDeck > 0)
            {
                int tempIndex = rnd.Next(cardsInDeck);

                Cards.Add(Shuffler[tempIndex]);
                Shuffler.RemoveAt(tempIndex);

                cardsInDeck--;
            }
        }
 public void Hit()
 {
     Cards.Add(_deck.DrawCard());
 }