private void btnPlay_Click(object sender, EventArgs e)
        {
            FormGameOptions FormGameOptions = new FormGameOptions();

            FormGameOptions.FormTitleScreen = this;
            this.Hide();
            FormGameOptions.ShowDialog(); //once formpoker closese, formgameoptions will close and menu form will popup
            this.Show();                  //menu pops up to allow users to view their score, consult the user manual, or start a new game
            if (user.getUserName() != "default" && user.getPassword() != "default")
            {
                user.reLoadFromFile(); //reloads the user account so that the updated score would show.
            }
        }
Esempio n. 2
0
 public void matchStart()
 {
     if (PlayerWon() != 0)
     {
         TimerWait3Seconds.Stop();
         lblBanner.Hide();
         //Checks if the player has won at start of new round
         if (PlayerWon() == 1)
         {
             if (user.getUserName() != "default" && user.getPassword() != "default")
             {
                 user.AddWin();
                 user.WriteToFile();
             }
             panelBubble.Hide();
             FormEndGame FormEndGame = new FormEndGame(true);
             FormEndGame.StartPosition = FormStartPosition.CenterScreen;
             FormEndGame.FormPoker     = this;
             FormEndGame.Text          = "You won!";
             FormEndGame.ShowDialog();
         }
         else if (PlayerWon() == -1)
         {
             if (user.getUserName() != "default" && user.getPassword() != "default")
             {
                 user.AddLose();
                 user.WriteToFile();
             }
             panelBubble.Hide();
             FormEndGame FormEndGame = new FormEndGame(false);
             FormEndGame.StartPosition = FormStartPosition.CenterScreen;
             FormEndGame.FormPoker     = this;
             FormEndGame.Text          = "You lost!";
             FormEndGame.ShowDialog();
         }
         return;
     }
     HideControls();
     for (int i = 0; i < pokerTable.getPlayers().Count; i++)
     {
         if (pokerTable[i].IsFolded())
         {
             panelList[i].BackgroundImage = Image.FromFile("panelNormal.png");
         }
     }
     //resetting variables to start new match
     timerCount    = 0;
     showdownCount = 0;
     lblBanner.Show();
     if (pokerTable.RoundCount == 10)
     {
         lblBanner.Text = "The minimum blinds have" + Environment.NewLine + "been raised";
     }
     else
     {
         lblBanner.Text = "New Round";
     }
     pokerTable.startNextMatch();
     pokerTable.DealHoleCards();
     DrawToScreen();
     updateMove();
     lblBubble.Text = pokerTable[pokerTable.getCurrentIndex()].Name + " is the dealer";
     TimerNextMove.Start();
 }