예제 #1
0
 private void btnLevelChange_Click(object sender, EventArgs e)
 {
     if (theUser.Level == 1)
     {
         // Level number 3 means level one has been played and level two will now be played
         theUser.Level = 3;
         Form frmL2Q1 = new frmL2Q1(ref theUser);
         frmL2Q1.Show();
         this.Close();
     }
     else if (theUser.Level == 2)
     {
         // Level number 4 means level two has been played and level one will now be played
         theUser.Level = 4;
         Form frmL1Q1 = new frmL1Q1(ref theUser);
         frmL1Q1.Show();
         this.Close();
     }
 }
예제 #2
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     //The time the user selects
     if (cbbQuestionTime.Text == "No Limit")
     {
         theUser.Time = 0;
     }
     else if (cbbQuestionTime.Text == "Expert")
     {
         theUser.Time = 180;
     }
     else if (cbbQuestionTime.Text == "Novice")
     {
         theUser.Time = 240;
     }
     else if (cbbQuestionTime.Text == "Beginner")
     {
         theUser.Time = 300;
     }
     else
     {
         theUser.Time = 0;
     }
     //The level that the user selected
     if (cbbLevel.Text == "Level One")
     {
         //Code sets level and checks if level one/two has been played
         if (theUser.Level == 0)
         {
             theUser.Level = 1;
         }
         else if (theUser.Level == 1)
         {
             theUser.Level = 1;
         }
         else
         {
             theUser.Level = 3;
         }
         Form frmL1Q1 = new frmL1Q1(ref theUser);
         frmL1Q1.Show();
         this.Close();
     }
     else
     {
         //Code checks if level one/two has been previosly played
         if (theUser.Level == 0)
         {
             theUser.Level = 2;
         }
         else if (theUser.Level == 2)
         {
             theUser.Level = 2;
         }
         else
         {
             theUser.Level = 4;
         }
         //goto level two
         Form frmL2Q1 = new frmL2Q1(ref theUser);
         frmL2Q1.Show();
         this.Close();
     }
 }