Exemplo n.º 1
0
 public void RemoveStat(Question q)
 {
     if (stats.ContainsKey(q))
     {
         stats.Remove(q);
     }
 }
Exemplo n.º 2
0
 public int Punish(Question q)
 {
     return --stats[q];
 }
Exemplo n.º 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;
 }
Exemplo n.º 4
0
 public int Award(Question q)
 {
     return ++stats[q];
 }
Exemplo n.º 5
0
 public void removeQuestion()
 {
     qsel.RemoveStat(currentQuestion);
     currentQuestion = null;
 }
Exemplo n.º 6
0
 public bool nextQuestion()
 {
     return (currentQuestion = qsel.next(currentQuestion)) != null;
 }