Esempio n. 1
0
        private void StartBTN_Click(object sender, RoutedEventArgs e)
        {
            this.thread.Abort();//TODO:find place for it
            StartGameResponse response = (StartGameResponse)Communicator.Communicate(new StartGameRequest());
            QuestionWindow    wind     = new QuestionWindow(this.username, this.room.roomName, this.room.numberOfQuestions, 0, this.room.TimeForQuestion);

            wind.Show();
            this.Hide();
            this.Close();
        }
Esempio n. 2
0
        private async void TimerFunc()
        {
            for (int i = 0; i < this.questionTime; i++)
            {
                await Task.Delay(1000);

                TBTimeLeft.Text = (int.Parse(TBTimeLeft.Text) - 1).ToString();
            }
            if (answerId == -1)
            {
                Random rnd = new Random();
                answerId = rnd.Next(0, 3);
            }
            SubmitAnswerResponse response = (SubmitAnswerResponse)Communicator.Communicate(new SubmitAnswerRequest((uint)answerId));
            QuestionWindow       wind     = new QuestionWindow(this.username, this.roomname, this.numOfQuestions, this.currentQuestionNum + 1, this.questionTime);

            if (this.numOfQuestions != this.currentQuestionNum + 1)
            {
                wind.Show();
            }
            this.Hide();
            this.Close();
        }
Esempio n. 3
0
 private void InvisibleStartBTN_Click(object sender, RoutedEventArgs e)
 {
     QuestionWindow wind = new QuestionWindow(this.username, this.room.roomName, this.room.numberOfQuestions, 0, this.room.TimeForQuestion);
 }