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); } }
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(); }
protected virtual void OnCardDealt(CardDealtEventArgs e) { CardDealt?.Invoke(this, e); }