//timer to start next round private void TimerWait3Seconds_Tick(object sender, EventArgs e) { if (PlayerBustedOut()) { TimerWait3Seconds.Stop(); timerBusted.Start(); return; } matchStart(); TimerWait3Seconds.Stop(); }
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(); }