Esempio n. 1
0
 void OnPlayerActionTaken(object sender, PlayerActionEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<PlayerActionEventArgs>(OnPlayerActionTaken), new[] { sender, e });
         return;
     }
     SuspendLayout();
     var p = e.Player;
     var php = m_Huds[p.NoSeat];
     var bet = m_Bets[p.NoSeat];
     var table = m_Game.Table;
     php.SetMoney(p.MoneySafeAmnt);
     php.SetSleeping();
     php.DoAction(e.Action, e.AmountPlayed);
     lblTotalPot.Text = Resources.PlayerHud_SetMoney_Dollar + table.TotalPotAmnt;
     if (e.Action == GameActionEnum.Fold)
         php.SetCards(GameCard.NoCard, GameCard.NoCard);
     if (p.MoneyBetAmnt > 0)
         bet.Text = Resources.PlayerHud_SetMoney_Dollar + p.MoneyBetAmnt;
     ResumeLayout();
 }
Esempio n. 2
0
 void OnPlayerActionTaken_Console(object sender, PlayerActionEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<PlayerActionEventArgs>(OnPlayerActionTaken_Console), new[] { sender, e });
         return;
     }
     WriteLine(e.Player.Name + " did [" + e.Action.ToString() + "]");
 }
 void OnPlayerActionTaken(object sender, PlayerActionEventArgs e)
 {
     var p = e.Player;
     Send(new PlayerTurnEndedCommand()
     {
         NoSeat = p.NoSeat,
         TotalPlayedMoneyAmount = p.MoneyBetAmnt,
         TotalSafeMoneyAmount = p.MoneySafeAmnt,
         TotalPot = Game.Table.TotalPotAmnt,
         ActionTakenType = e.Action,
         ActionTakenAmount = e.AmountPlayed,
         PlayerState = p.State,
     });
 }