Esempio n. 1
0
        private void FillTextBoxes(GroupBox groupBox)
        {
            if (questionController.GetCurrentQuestion() == null)
            {
                return;
            }

            var source = questionController.GetCurrentQuestion().GetQuestionData().ToList();
            var dest   = groupBox.Controls.OfType <TextBox>().ToList();

            for (int i = 0; i < dest.Count; i++)
            {
                dest[i].Text = source[i];
            }
        }
Esempio n. 2
0
        private void NewQuestion()
        {
            if (questionController.CurrentIndex == questionController.GameRules.QuestionNumber)
            {
                Victory();
            }

            questionController.CurrentQuestionState = QuestionType.Default;
            ResetAnswersState();
            UpdateCounter(counterLabel, 1);
            FillQuestionData(answersPanel, questionController.GetCurrentQuestion());
            ShuffleAnswers();
            timerLabel.Text = questionController.GameRules.TimeToAnswer.ToString();
            questionController.TimeLeftToAnswer = questionController.GameRules.TimeToAnswer;
            questionController.timer.Start();
            prizeLabel.Text = $"Текущий выигрыш: {questionController.GameRules.GetCurrentPrize(questionController.CurrentIndex)} рублей";
        }