Пример #1
0
        public void SetCards(List <Card> cards)
        {
            foreach (Card card in cards)
            {
                Cards.Add(card);
                card.CardState = CardState.NONE;
                switch (card.CardShape)
                {
                case Shapes.CLUBS:
                    ClubsCards.Add(card);
                    break;

                case Shapes.DIAMONDS:
                    DiamondCards.Add(card);
                    break;

                case Shapes.HEARTS:
                    HeartsCards.Add(card);
                    break;

                case Shapes.SPADES:
                    SpadesCards.Add(card);
                    break;

                case Shapes.JOKER:
                    JokerCards.Add(card);
                    break;
                }
            }
        }
Пример #2
0
 public void ResetPlayer()
 {
     Cards.Clear();
     ClubsCards.Clear();
     DiamondCards.Clear();
     HeartsCards.Clear();
     SpadesCards.Clear();
     JokerCards.Clear();
     PickedCards.Clear();
 }
Пример #3
0
        public List <Card> Play(Card newCard)
        {
            var thrownCards = new List <Card>(PickedCards);

            //   thrownCards.Sort();

            foreach (var pCard in PickedCards)
            {
                Cards.Remove(pCard);
                ClubsCards.Remove(pCard);
                SpadesCards.Remove(pCard);
                HeartsCards.Remove(pCard);
                DiamondCards.Remove(pCard);
                JokerCards.Remove(pCard);
                pCard.Picked = false;
            }

            PickedCards.Clear();
            SetCards(new List <Card> {
                newCard
            });
            return(thrownCards);
        }