Ejemplo n.º 1
0
        private void btnActions_Click(object sender, EventArgs e)
        {
            try
            {
                if (sender == btnCheck)
                {
                    objPokerGame.Check(objPlayerYou);
                    WaitUntilComBet();
                }
                else if (sender == btnBet)
                {
                    float sngAmt = Convert.ToInt32(Interaction.InputBox("Enter amount you want to bet:", "Type the amount", "", -1, -1));

                    objPokerGame.Bet(objPlayerYou, sngAmt);
                    WaitUntilComBet();
                }
                else if (sender == btnCall)
                {
                    objPokerGame.DoCall(objPlayerYou);
                    WaitUntilComBet();
                }
                else
                {
                    objPokerGame.Fold(objPlayerYou);
                }
            }
            catch (InvalidCastException ex)
            {
                MessageBox.Show("Please enter a numeric value.");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }