示例#1
0
        public void selectQuestion(string player, string answer)
        {
            QA     currentQA      = questionsAsked.Last();
            Answer chosenAnswer   = currentQA.answers.First(ans => ans.text == answer);
            Player choosingPlayer = getPlayerByName(player);

            selectQuestion(choosingPlayer, chosenAnswer);
        }
示例#2
0
        public void FillAnswersForNonAnsweringPlayers()
        {
            QA currentQuestion = questionsAsked.Last();

            for (int i = 0; i < players.Count; i++)
            {
                if (!currentQuestion.answers.Exists(ans => ans.creator == players[i]))
                {
                    currentQuestion.answerQuestion(players[i], "", true);
                }
            }
        }
示例#3
0
        public string askQuestion()
        {
            List <Question> questions = new List <Question>();

            for (int i = 0; i < questionsAsked.Count; i++)
            {
                questions.Add(questionsAsked[i].question);
            }
            Question newQuestion = GameDBManager.getQuestion(questions);

            server.PublishChatMessage("Category: " + newQuestion.category);
            QA newQA = new QA(newQuestion);

            questionsAsked.Add(newQA);
            answeringOpen = true;
            //questionReady = true;
            startAnsweringTimer();
            return(JsonMapper.ToJson(newQA));
        }