示例#1
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (txtUserName.Text == "default" || txtPass.Text == "default") //default must not become a viable username (it is the default for a reason and also to indicate that no user has logged in)
     {
         MessageBox.Show("<default> as a password or a username is not allowed.");
     }
     else if (txtUserName.Text == "" || txtPass.Text == "" || txtPass.Text == "" || txtReEnterPass.Text == "")
     {
         MessageBox.Show("Please fill in the all the boxes to register.");
     }
     else if (txtPass.Text != txtReEnterPass.Text)
     {
         MessageBox.Show("Re-entered password must be the same as password.");
     }
     else
     {
         UserAccount user = new UserAccount(txtUserName.Text, txtPass.Text, txtPlayerName.Text);
         user.WriteToFile();
         Close();
     }
 }
示例#2
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (txtUserName.Text == "default" || txtPass.Text == "default") //default must not become a viable username (it is the default for a reason and also to indicate that no user has logged in)
     {
         MessageBox.Show("<default> as a password or a username is not allowed.");
     }
     else if (txtUserName.Text == "" || txtPass.Text == "" || txtPass.Text == "" || txtReEnterPass.Text == "")
     {
         MessageBox.Show("Please fill in the all the boxes to register.");
     }
     else if (txtPass.Text != txtReEnterPass.Text)
     {
         MessageBox.Show("Re-entered password must be the same as password.");
     }
     else
     {
         UserAccount user = new UserAccount(txtUserName.Text, txtPass.Text, txtPlayerName.Text);
         user.WriteToFile();
         Close();
     }
 }
示例#3
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();
 }