예제 #1
0
파일: Game.cs 프로젝트: 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();
        }
예제 #2
0
 public string GetAnswers(Question question)
 {
     return(string.Join(",", Answers.Where(a => a.QuestionId == question.QuestionId).Select(b => b.AnswerText)));
 }