Ejemplo n.º 1
0
Archivo: Game.cs Proyecto: 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();
        }
Ejemplo n.º 2
0
 public string GetAnswers(Question question)
 {
     return(string.Join(",", Answers.Where(a => a.QuestionId == question.QuestionId).Select(b => b.AnswerText)));
 }