예제 #1
0
        // TODO override Pile.Push to prevent illegal initialization

        public Trick GetTrick()
        {
            var trumpWasPlayed = _playedCards.Values.Any(card => _trump.IsTrumpCard(card));
            var taker          = (from pair in _playedCards
                                  let player = pair.Key
                                               let card = pair.Value
                                                          where !trumpWasPlayed || _trump.IsTrumpCard(card)
                                                          orderby card.Rank descending
                                                          select player).First();

            return(new Trick(CardsInPile, taker));
        }
예제 #2
0
파일: Hand.cs 프로젝트: sm-g/SimpleCards
 public bool HasTrump(Trump trump) => CardsInPile.Any(card => trump.IsTrumpCard(card));