Example #1
0
 public bool CheckAnswer( int answer )
 {
     if(_current.RightAnswer == answer)
     {
         _current = _repository.GetAQuestion();
         return true;
     }
     else
     {
         GameOver = true;
         _current = null;
         return false;
     }
 }
        private QuestionItem Create( string question, string answer )
        {
            var q = new QuestionItem();
            q.QuestionGuid = Guid.NewGuid();

            q.RightAnswer = _random.Next(0, 4);

            q.Answers = new string[4];
            q.Question = question;

            q.Answers[0] = "falsch";
            q.Answers[1] = "falsch";
            q.Answers[2] = "falsch";
            q.Answers[3] = "falsch";

            q.Answers[q.RightAnswer] = answer;

            return q;
        }
Example #3
0
 public Game( string playerName )
 {
     PlayerName = playerName;
     _repository = new QuestionRepository();
     _current = _repository.GetAQuestion();
 }