void OnPlayerWonPot_Console(object sender, PotWonEventArgs e) { if (InvokeRequired) { // We're not in the UI thread, so we need to call BeginInvoke BeginInvoke(new EventHandler <PotWonEventArgs>(OnPlayerWonPot_Console), new[] { sender, e }); return; } WriteLine(e.Player.Name + " won pot ($" + e.AmountWon + ") with " + e.Hand + " [" + string.Join(",", e.Cards) + "]"); }
void OnPlayerWonPot(object sender, PotWonEventArgs e) { var evaluatedPlayer = e.Player; //Send(new PlayerWonPotCommand() //{ // NoSeat = evaluatedPlayer.CardsHolder.Player.NoSeat, // PotId = e.PotId, // WonAmount = e.AmountWon, // TotalPlayerMoney = evaluatedPlayer.CardsHolder.Player.MoneySafeAmnt, // TotalPotAmount = e.TotalPotAmount, // WinningCards = evaluatedPlayer.Evaluation.Cards.SelectMany(x => x).Take(5).Select(x => x.ToString()).ToArray(), // WinningHand = evaluatedPlayer.Evaluation == null ? PokerHandEnum.None : (PokerHandEnum)Enum.Parse(typeof(PokerHandEnum), evaluatedPlayer.Evaluation.Hand.ToString()) //}); }
void OnPlayerWonPot(object sender, PotWonEventArgs e) { if (InvokeRequired) { // We're not in the UI thread, so we need to call BeginInvoke BeginInvoke(new EventHandler <PotWonEventArgs>(OnPlayerWonPot), new[] { sender, e }); return; } SuspendLayout(); var p = e.Player; var php = m_Huds[p.NoSeat]; php.SetMoney(p.MoneySafeAmnt); php.SetWinning(); ResumeLayout(); }