예제 #1
0
        private static bool UpdateChosenCard(Trick trick, Player player, Player currentPlayer, int number)
        {
            bool askHumanForChoice;
            var  chosenCard = player.SortedHand()[number - 1];

            trick.Cards.Add(chosenCard);
            player.Discard(chosenCard);
            askHumanForChoice = false;
            Console.WriteLine(String.Format("{0} plays {1}", player.Name, chosenCard));
            if (player == currentPlayer)
            {
                trick.FirstCard = chosenCard;
            }
            return(askHumanForChoice);
        }
예제 #2
0
 private static bool IsInputAndSuitCorrect(Trick trick, Player player, string chosenNumber, out int number)
 {
     return(Int32.TryParse(chosenNumber, out number) && (number <= player.Hand.Count()) && (player.SortedHand()[number - 1].Suit == trick.FirstCard.Suit));
 }