예제 #1
0
파일: Program.cs 프로젝트: DSTech/Stoody
 public void RemoveStat(Question q)
 {
     if (stats.ContainsKey(q))
     {
         stats.Remove(q);
     }
 }
예제 #2
0
파일: Program.cs 프로젝트: DSTech/Stoody
 public int Punish(Question q)
 {
     return --stats[q];
 }
예제 #3
0
파일: Program.cs 프로젝트: DSTech/Stoody
 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;
 }
예제 #4
0
파일: Program.cs 프로젝트: DSTech/Stoody
 public int Award(Question q)
 {
     return ++stats[q];
 }
예제 #5
0
파일: Program.cs 프로젝트: DSTech/Stoody
 public void removeQuestion()
 {
     qsel.RemoveStat(currentQuestion);
     currentQuestion = null;
 }
예제 #6
0
파일: Program.cs 프로젝트: DSTech/Stoody
 public bool nextQuestion()
 {
     return (currentQuestion = qsel.next(currentQuestion)) != null;
 }