示例#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);
            }
        }
示例#2
0
 private void ButtonCheck_Click(object sender, EventArgs e)
 {
     _game.Check();
     MainUpdate();
 }
示例#3
0
        public void TestRoundIncrements()
        {
            // Arrange
            CreatePropperties();
            // Round 1
            Game.Call();
            Game.Check();
            // Round 2
            Game.Check();
            Game.Check();
            // Round 3
            Game.Check();
            Game.Check();
            // Round 4
            Game.Check();
            Game.Check();
            // Round 5
            Game.Check();
            Game.Check();

            var expected = 5;

            // Act
            var actual = Game.Hands[Game.CurrentHandNumber() - 1].CurrentRoundNumber();

            // Assert
            Assert.AreEqual(expected, actual);
        }