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