public IReadOnlyCollection <Card> GetPossibleOpponentCards() { if (this.CardMemorizer.OldTrumpCard == null) { return(this.CardMemorizer.UndiscoveredCards); } var result = new Tools.CardCollection(); this.CardMemorizer.UndiscoveredCards.ForEach(result.Add); result.Add(this.CardMemorizer.OldTrumpCard); return(result); }
public CardMemorizer(Card trumpCard, ICollection <Card> initialHand) { this.TrumpCard = trumpCard; this.RemainingTrumpCardsCount = 0; this.TrumpCardDrawn = false; this.undiscoveredCards = new Tools.CardCollection(); this.myHand = new Tools.CardCollection(); this.myPlayedCards = new Tools.CardCollection(); this.opponentPlayedCards = new Tools.CardCollection(); foreach (var card in CardMemorizer.AllCards) { if (card.Equals(this.TrumpCard)) { continue; } if (initialHand.Contains(card)) { this.myHand.Add(card); } else { this.undiscoveredCards.Add(card); if (card.Suit == this.TrumpCard.Suit) { this.RemainingTrumpCardsCount++; } } } if (this.myHand.Count != CardMemorizer.InitialHandValidSize) { throw new ArgumentException($"Initial hand size must be {CardMemorizer.InitialHandValidSize}."); } }