예제 #1
0
        private void DecideBetterHand()
        {
            try
            {
                objBetterHandPlayer = objPokerGame.DecideBetterHandPlayer();
                switch (true)
                {
                case object _ when objBetterHandPlayer == objPlayerYou:
                {
                    btnCheck.Enabled = true;
                    btnBet.Enabled   = true;
                    btnCall.Enabled  = false;
                    btnFold.Enabled  = true;
                    break;
                }

                case object _ when objBetterHandPlayer == objPlayerCom:
                {
                    WaitUntilComBet();
                    if (objPokerGame.Players.Count == 2)
                    {
                        btnCheck.Enabled = false;
                        btnBet.Enabled   = false;
                        btnCall.Enabled  = true;
                        btnFold.Enabled  = true;
                    }

                    break;
                }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }