.prune removed, Cards are now per-server, trivia fixed, more stats

This commit is contained in:
Master Kwoth
2016-02-10 23:35:19 +01:00
parent 8bf7961aef
commit 5977bcd2b6
4 changed files with 63 additions and 61 deletions

View File

@ -20,15 +20,15 @@ namespace NadekoBot.Classes.Trivia {
Reload();
}
public TriviaQuestion GetRandomQuestion(List<TriviaQuestion> exclude) =>
pool.Except(exclude).FirstOrDefault();
public TriviaQuestion GetRandomQuestion(List<TriviaQuestion> exclude) =>
pool.Except(exclude).ToList()[_r.Next(0, pool.Count)];
internal void Reload() {
JArray arr = JArray.Parse(File.ReadAllText("data/questions.txt"));
foreach (var item in arr) {
TriviaQuestion tq;
tq = new TriviaQuestion(item["Question"].ToString(), item["Answer"].ToString(),item["Category"]?.ToString());
tq = new TriviaQuestion(item["Question"].ToString(), item["Answer"].ToString(), item["Category"]?.ToString());
pool.Add(tq);
}
var r = new Random();