示例#1
0
 private void OnCardDealt(object sender, CardDealtEventArgs e)
 {
     if (e.DealtTo is Player)
     {
         lstPlayer.Items.Add(e.Card);
         lblPlayerTotal.Text = "Total: " + _game.Player.Hand.Total;
     }
     else if (e.DealtTo is Dealer)
     {
         UpdateDealerCards(true);
     }
 }
示例#2
0
        private static void OnCardDealt(object sender, CardDealtEventArgs e)
        {
            Console.Clear();

            PrintHeader();

            Console.Write(game.MainPlayer.Name + ":\t\t");
            foreach (var card in game.MainPlayer.Hand)
            {
                Console.Write(card.ToString() + " ");
            }
            Console.Write("<" + game.GetHandScore(game.MainPlayer.Hand) + "> " + game.MainPlayer.Status);
            Console.WriteLine();

            Console.Write(game.DealerInfo.Name + ":\t\t");
            foreach (var card in game.DealerInfo.Hand)
            {
                Console.Write(card.ToString() + " ");
            }
            Console.Write("<" + game.GetHandScore(game.DealerInfo.Hand) + "> " + game.DealerInfo.Status);
            Console.WriteLine();
        }
示例#3
0
 protected virtual void OnCardDealt(CardDealtEventArgs e)
 {
     CardDealt?.Invoke(this, e);
 }