//Method to reset the window and open a new session private void resetButton_Click(object sender, EventArgs e) { PlaceBetForm placeBetForm = new PlaceBetForm(dal); foreach (Player player in dal.game.playerList) { player.ResetPlayer(); } dal.game.ResetGame(dal); playerIndex = 0; placeBetForm.Show(); GameForm_Load(sender, e); this.Hide(); }
//Method to add player to game public void AddPlayer() { //Add Player to game dal.game.AddPlayers(playerNameTextBox.Text, playerChips, dal); //Reset interface if playersCreated < numberOfPlayers if (playersCreated < numberOfPlayers) { playerNameTextBox.Clear(); chipTextBox.Clear(); errorLabel.Hide(); errorLabel2.Hide(); playersCreated += 1; playerLabel.Text = "Voer naam in van speler " + playersCreated; } else { //Continu program to next window PlaceBetForm placeBetForm = new PlaceBetForm(dal); this.Hide(); placeBetForm.Show(); } }