コード例 #1
0
        public void loadQuestion()
        {
            if (this.questionList.Count == 0)
            {
                this.Hide();
                endGame = new frmEndGame();
                endGame.totalPoint = this.scoreLabel.Text;
                endGame.incorrect = this.incorrectAnswer;
                endGame.correct = this.correctAnswer;
                this.endGame.ShowDialog();

            }
            else
            {
                lblCorrectAnswer.Text = " ";
                this.answerChoice1.Checked = false;
                this.answerChoice2.Checked = false;
                this.answerChoice3.Checked = false;
                this.answerChoice4.Checked = false;

                //Loads a new question
                this.getQuestion();
                //Loads the answer choices for the question
                int id = this.question.QuestionID;
                this.answerList = new List<Answers>();
                this.answerList = BrainFartController.GetAllAnswerChoices(id);
                questionDescripLabel.Text = this.question.QuestionDescrip;
                answerChoice1.Text = this.answerList[0].AnswerDescrip;
                answerChoice2.Text = this.answerList[1].AnswerDescrip;
                answerChoice3.Text = this.answerList[2].AnswerDescrip;
                answerChoice4.Text = this.answerList[3].AnswerDescrip;
                //Loads the question's category
                int categoryID = this.question.CategoryID;
                this.categoriesTableAdapter.Fill(this.categoriesDataSet.categories, categoryID);
                //Loads the question's difficulty and point value
                int difficultyID = this.question.DifficultyID;
                this.difficultiesTableAdapter.Fill(this.difficultiesDataSet.difficulties, difficultyID);
            }
        }
コード例 #2
0
        private void gameMode()
        {
            if(this.gameOverMode.Equals("Three Strikes"))
            {
                if (this.correct.Equals("Incorrect"))
                {
                    this.strike++;
                    MessageBox.Show("Strike " + this.strike,
                    "BrainFart ",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error,
                    MessageBoxDefaultButton.Button1);

                    if(this.strike == 3)
                    {
                        this.Hide();
                        endGame = new frmEndGame();
                        endGame.totalPoint = this.scoreLabel.Text;
                        endGame.incorrect = this.incorrectAnswer;
                        endGame.correct = this.correctAnswer;
                        this.endGame.ShowDialog();
                    }

                }
            }
        }