/******************************************************************************** * * Method: Choose_Difficulty_Playing_Field * * Arguments: object sender, MouseEventArgs e * * Return Type: void * * Purpose: Chooses difficulty for the form to be pulled up. * * *******************************************************************************/ private void Choose_Difficulty_Playing_Field(object sender, MouseEventArgs e) { Form1 form1 = new Form1(); RadioButton EasyRB = EasyRadioButton; RadioButton MediumRB = MediumRadioButton; RadioButton HardRB = HardRadioButton; if (EasyRB.Checked) { InitializeEasyData(); Easy_Form easy_Form = new Easy_Form(easyData1); easy_Form.Show(); this.Hide(); form1.Close(); } else if (MediumRB.Checked) { InitializeMediumData(); Medium_Form medium_Form1 = new Medium_Form(mediumData1); medium_Form1.Show(); this.Hide(); form1.Close(); } else if (HardRB.Checked) { InitializeHardData(); Hard_Form hard_Form = new Hard_Form(hardData1); hard_Form.Show(); this.Hide(); form1.Close(); } else { MessageBox.Show("Select difficulty level.", "ERROR"); } }
/******************************************************************************** * * Method: Back_Button_Click * * Arguments: object sender, EventArgs e * * Return Type: void * * Purpose: Saves the game upon going back. * * *******************************************************************************/ private void Back_Button_Click(object sender, EventArgs e) { ED = new EasyData(); ED.easy_summation_matrix = summation_matrix; ED.should_display_number = should_display_number; ED.initially_displayed = initially_displayed; ED.easy_right_edge = right_edge; ED.easy_bottom_edge = bottom_edge; ED.easy_custom_summation_matrix = custom_summation_matrix; ED.easy_custom_right_edge = custom_right_edge; ED.easy_custom_bottom_edge = custom_bottom_edge; Form1 form1 = new Form1(ED); Easy_Form Easy_Form = new Easy_Form(ED); form1.Show(); this.Hide(); Easy_Form.Close(); }