Ejemplo n.º 1
0
 void OnPlayerLeft_Console(object sender, PlayerInfoEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<PlayerInfoEventArgs>(OnPlayerLeft_Console), new[] { sender, e });
         return;
     }
     WriteLine(e.Player.Name + " left the table");
 }
Ejemplo n.º 2
0
 void OnPlayerHoleCardsChanged_Console(object sender, PlayerInfoEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<PlayerInfoEventArgs>(OnPlayerHoleCardsChanged_Console), new[] { sender, e });
         return;
     }
     var p = e.Player;
     if (new GameCard(p.HoleCards[0]).Id >= 0)
         WriteLine("==> Hole Card changed for " + p.Name + ": " + p.HoleCards[0] + " " + p.HoleCards[1]);
 }
Ejemplo n.º 3
0
 void OnPlayerMoneyChanged(object sender, PlayerInfoEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<PlayerInfoEventArgs>(OnPlayerMoneyChanged), new[] { sender, e });
         return;
     }
     SuspendLayout();
     var p = e.Player;
     var php = m_Huds[p.NoSeat];
     php.SetMoney(p.MoneySafeAmnt);
     ResumeLayout();
 }
Ejemplo n.º 4
0
 void OnPlayerHoleCardsChanged(object sender, PlayerInfoEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<PlayerInfoEventArgs>(OnPlayerHoleCardsChanged), new[] { sender, e });
         return;
     }
     SuspendLayout();
     var p = e.Player;
     var php = m_Huds[p.NoSeat];
     if(p.HoleCards.Length == 2)
         php.SetCards(new GameCard(p.HoleCards[0]), new GameCard(p.HoleCards[1]));
     else
         php.SetCards(null, null);
     ResumeLayout();
 }
Ejemplo n.º 5
0
 void OnPlayerActionNeeded(object sender, PlayerInfoEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<PlayerInfoEventArgs>(OnPlayerActionNeeded), new[] { sender, e });
         return;
     }
     SuspendLayout();
     var p = e.Player;
     var php = m_Huds[p.NoSeat];
     php.DoAction(GameActionEnum.DoNothing);
     php.SetPlaying();
     ResumeLayout();
 }
Ejemplo n.º 6
0
 void OnPlayerActionNeeded(object sender, PlayerInfoEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<PlayerInfoEventArgs>(OnPlayerActionNeeded), new[] { sender, e });
         return;
     }
     var p = e.Player;
     var table = m_Game.Table;
     if (p.NoSeat == m_NoSeat)
     {
         EnableButton(btnFold);
         SetCallButtonName(p);
         EnableButton(btnCall);
         if (table.HigherBet < p.MoneyAmnt)
         {
             var min = table.MinRaiseAmnt(p) + p.MoneyBetAmnt;
             EnableButton(btnRaise);
             nudRaise.Enabled = true;
             nudRaise.Minimum = min;
             nudRaise.Maximum = p.MoneyAmnt;
             nudRaise.Value = min;
             nudRaise.Increment = min;
         }
     }
 }