//Purpose:to Display the winners and ask if the players //would like to play again //Requires:the players current cash from the player class //Returns:Nothing private void displayWinners() { Question_Box.Show(); Question_Box.Clear(); //Conditional statements to see who has the most cash if (p1.cash > p2.cash && p1.cash > p3.cash) { Question_Box.AppendText(p1.pName + " is the winner! With $" + p1.cash + "\n"); Question_Box.AppendText("Would you like to play another game?"); } else if (p2.cash > p1.cash && p2.cash > p3.cash) { Question_Box.AppendText(p2.pName + " is the winner! With $" + p2.cash + "\n"); Question_Box.AppendText("Would you like to play another game?"); } else if (p3.cash > p1.cash && p3.cash > p2.cash) { Question_Box.AppendText(p3.pName + " is the winner! With $" + p3.cash + "\n"); Question_Box.AppendText("Would you like to play another game?"); } else { Question_Box.AppendText(p1.pName + " " + p2.pName + " " + p3.pName + " Looks like no one won!\n"); Question_Box.AppendText("Would you like to play another game?"); } Yes_Button.Show(); No_Button.Show(); }
//Purpose:To see if the Player would like to play another game //Requires: Nothing //Returns:Nothing private void Yes_Button_Click(object sender, EventArgs e) { beginagain(); Yes_Button.Hide(); No_Button.Hide(); rounds(); }
//Below are the various functions used that are implemented in //the buttons listed above. //Purpose: To Hide all Components that are not //needed at the begining of the game //Requires:Nothing //Returns;Nothing private void hideComponents() { Question_Box.Hide(); Boarder_Box.Hide(); Answers_Textbox.Hide(); Answer_Button.Hide(); Start_Button.Hide(); Next_Question_Button.Hide(); SpinButton.Hide(); Begin_Spin_Round.Hide(); Spin_Round_Instruction.Hide(); Set_Name.Hide(); Player1_textBox.Hide(); playertwo_TextBox.Hide(); Playerthree_textBox.Hide(); Playerthree_label.Hide(); Playertwo_Label.Hide(); Playerone_Label.Hide(); Yes_Button.Hide(); No_Button.Hide(); Next_Round_button.Hide(); Quit_Button.Hide(); }