Example #1
0
 internal async void Fold(int gameID, Game gameWindow)
 {
     if (await Communication.GameFunctions.Instance.bet(gameID, "Fold"))
     {
         gameWindow.HideBetElements();
         MessageBox.Show("You have folded", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }
Example #2
0
        internal async void Bet(int gameID, string amount, int minimumBet, Game gameWindow)
        {
            int betAmount = 0;

            if (Int32.TryParse(amount, out betAmount) && betAmount >= minimumBet)
            {
                if (await Communication.GameFunctions.Instance.bet(gameID, betAmount.ToString()))
                {
                    gameWindow.HideBetElements();
                    //MessageBox.Show("Bet Accepted", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    MessageBox.Show("Bet is over your credit! \nplease try again.", "Too Low!", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            else
            {
                MessageBox.Show("Minimum bet is " + minimumBet + "! please try again.", "Too Low!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }