Esempio n. 1
0
File: Game.cs Progetto: godzpaw/Quiz
        private void ChoosenAnswer(Answers selected)
        {
            if (!selected.isValid)
            {
                this.FailedPlayersIds.Add(this.CurrentPlayer);
            }
            else
            {
                this.Scores[int.Parse(this.CurrentPlayer.ToString())] += this.CurrentQuestion.points;
            }

            if (this.Players == this.FailedPlayersIds.Count || false)
            {
                this.GameEnd();
                return;
            }

            this.UpdateScores();
            this.NextPlayer();
            this.UpdateWhichPLayer();
            this.NextQuestion();
        }
Esempio n. 2
0
 public string GetAnswers(Question question)
 {
     return(string.Join(",", Answers.Where(a => a.QuestionId == question.QuestionId).Select(b => b.AnswerText)));
 }