Example #1
0
 public void RemoveStat(Question q)
 {
     if (stats.ContainsKey(q))
     {
         stats.Remove(q);
     }
 }
Example #2
0
 public int Punish(Question q)
 {
     return --stats[q];
 }
Example #3
0
 public Question next(Question lastQuestion)
 {
     int currentLowest = int.MaxValue;
     List<Question> retlist = new List<Question>();
     foreach (Question q in stats.Keys)
     {
         if (stats[q] < currentLowest)
         {
             retlist.Clear();
             if (q != lastQuestion || lastQuestion == null || stats.Keys.Count == 1)
             {
                 retlist.Add(q);
                 currentLowest = stats[q];
             }
         }
         else if (stats[q] == currentLowest)
         {
             if (q != lastQuestion || lastQuestion == null || stats.Keys.Count == 1)
             {
                 retlist.Add(q);
             }
         }
     }
     return (retlist.Count() > 0) ? (retlist[r.Next(retlist.Count())]) : null;
 }
Example #4
0
 public int Award(Question q)
 {
     return ++stats[q];
 }
Example #5
0
 public void removeQuestion()
 {
     qsel.RemoveStat(currentQuestion);
     currentQuestion = null;
 }
Example #6
0
 public bool nextQuestion()
 {
     return (currentQuestion = qsel.next(currentQuestion)) != null;
 }