public Question(UserGameSession gameSession) { Guesses = new List<string>(); Score = gameSession.Score; CurrentQuestion = gameSession.currentQuestion; TimeRemaining = gameSession.timeLeft; TotalQuestions = gameSession.GameSettings.Questions; CorrectAnswerString = gameSession.gameModule.rightAnswerString; IncorrectAnswerString = gameSession.gameModule.wrongAnswerString; CorrectAnswer = GetCorrectAnswer(gameSession.gameModule.Answers); if (CorrectAnswer == "error") { Shuffle(gameSession.gameModule.Answers); CorrectAnswer = GetCorrectAnswer(gameSession.gameModule.Answers); // Doesn't check for error again } Guesses.Add(CorrectAnswer); AddWrongAnswers(gameSession.GameSettings.Answers, gameSession.gameModule.Answers); Guesses.Shuffle(); }
public Question(UserGameSession gameSession) { Guesses = new List <string>(); Score = gameSession.Score; CurrentQuestion = gameSession.currentQuestion; TimeRemaining = gameSession.timeLeft; TotalQuestions = gameSession.GameSettings.Questions; CorrectAnswerString = gameSession.gameModule.rightAnswerString; IncorrectAnswerString = gameSession.gameModule.wrongAnswerString; CorrectAnswer = GetCorrectAnswer(gameSession.gameModule.Answers); if (CorrectAnswer == "error") { Shuffle(gameSession.gameModule.Answers); CorrectAnswer = GetCorrectAnswer(gameSession.gameModule.Answers); // Doesn't check for error again } Guesses.Add(CorrectAnswer); AddWrongAnswers(gameSession.GameSettings.Answers, gameSession.gameModule.Answers); Guesses.Shuffle(); }