예제 #1
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();
 }
예제 #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();
 }