예제 #1
0
 private static void PrintWinLossString(Player player)
 {
     if (player.Status != Status.Undetermined || player.GetType() == typeof(Dealer))
     {
         Console.ForegroundColor = (player.Status == Status.Win) ? ConsoleColor.Green : ConsoleColor.Red;
         Console.Write("{0} ({1})", player.Status.ToString(), player.Hand.Evaluate());
         Console.ForegroundColor=ConsoleColor.White;
     }
     Console.WriteLine("");
 }
예제 #2
0
 private static void PrintHandDetail(Player player, bool isComplete)
 {
     if (isComplete || player.GetType() != typeof(Dealer))
     {
         Console.Write("{0}: \t{1}"
                       , player.Name
                       , player.Hand.Cards.Select(card => card.SuitChar.ToString() + " " + card.Value)
                               .Aggregate((c, c1) => c + "\t" + c1) + "\t");
     }
     else
     {
         //Mask the Dealer's second card
         Console.Write("{0}: \t{1}"
                       , player.Name
                       , player.Hand.Cards.Select(card => card.SuitChar.ToString() + " " + card.Value)
                               .Aggregate((c, c1) => c + "\t??") + "\t");
     }
     if (isComplete)
     {
         PrintWinLossString(player);
     }
     Console.WriteLine("");
 }
 public void GiveCard(Player player, Game game)
 {
     player.Hand.Cards.Add(game.Shoe.DealNextCard());
 }