public Deck() { for (int suit = 0; suit < 4; suit++) { for (int value = 1; value < 14; value++) { var tmpCard = new Card (); switch(suit) { case 0: tmpCard.Suit = Suit.HEARTS; break; case 1: tmpCard.Suit = Suit.CLUBS; break; case 2: tmpCard.Suit = Suit.HEARTS; break; case 3: tmpCard.Suit = Suit.SPADES; break; } tmpCard.Value = value; _deck.Add (tmpCard); } } }
public void ChangeTrumpCard(Card newCard) { this.trumpCard = newCard; if (this.listOfCards.Count > 0) { this.listOfCards[0] = newCard; } }
public Deck() { this.listOfCards = new List<Card>(); foreach (var cardSuit in this.GetAllCardSuits()) { foreach (var cardType in this.GetAllCardTypes()) { this.listOfCards.Add(new Card(cardSuit, cardType)); } } this.listOfCards = this.listOfCards.Shuffle().ToList(); this.trumpCard = listOfCards[0]; }