示例#1
0
        public static void TrickSummary(PlayedTrick trick)
        {
            if (!Options.DisplayTrickSummary)
            {
                return;
            }

            foreach (var playedCard in trick.Cards)
            {
                ToBlue();
                Console.Write(" " + playedCard.Key.Name.PadLeft(Options.NamePad) + " ");
                ToGrey();
                Console.Write(" play ");
                Card(playedCard.Value);

                if (trick.Winner == playedCard.Key)
                {
                    ToBlue();
                    Console.Write(" Win");
                    int trickScore = trick.Cards.Select(i => i.Value).Score();

                    if (trickScore > 0)
                    {
                        Console.Write(" {0}pts", trickScore);
                    }
                }

                NewLine();
            }

            NewLine();
        }
示例#2
0
        public Player EvaluateWinner(PlayedTrick playedHand)
        {
            var leadSuit        = playedHand.Cards.First().Value.Suit;
            var cardsOfLeadSuit = playedHand.Cards.Where(i => i.Value.Suit == leadSuit);
            var highestRanked   = cardsOfLeadSuit.OrderByDescending(i => i.Value.Kind).First();

            return(highestRanked.Key);
        }
示例#3
0
 public static IEnumerable <Card> SelectCards(this PlayedTrick self)
 {
     return(self.Cards.Values);
 }