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); }
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); } } }
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)); }