Beispiel #1
0
        public void GameStart()
        {
            loadFile();

            _qTimer = new Timer();
            _qTimer.Tick += new EventHandler(qTimer_Tick);
            _qTimer.Interval = QUESTION_TIMER_INTERVAL;

            foreach (Guid user in _clientCallbacks.Keys)
            {
                _currentCall = _clientCallbacks[user];
                _currentCall.OnScoreUpdate(_scoreboard);
                _currentCall.OnGameStart(_questions.Count);
            }

            loadQuestion();
        }
Beispiel #2
0
        public void checkAnswers()
        {
            Question_Key qKey = (Question_Key)_questions[_questionIndex];

            foreach (string userNameKey in _answers.Keys)
            {
                answerKey ans_key = (answerKey)_answers[userNameKey];

                if (qKey.Correct == ans_key.a_Key)
                {
                    _scoreboard[userNameKey] += 1;
                }
            }

            foreach (Guid key in _clientCallbacks.Keys)
            {
                _currentCall = _clientCallbacks[key];
                _currentCall.OnScoreUpdate(_scoreboard);
            }
        }