コード例 #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("");
 }
コード例 #3
0
 public void GiveCard(Player player, Game game)
 {
     player.Hand.Cards.Add(game.Shoe.DealNextCard());
 }