Implement trivia welcome screen with category picker

This commit is contained in:
2022-12-21 17:59:25 +01:00
parent d4c3afbddd
commit 1c19f3c07f
13 changed files with 184 additions and 40 deletions

View File

@@ -0,0 +1,17 @@
package wtf.beatrice.hidekobot.objects.comparators;
import wtf.beatrice.hidekobot.objects.fun.TriviaCategory;
import wtf.beatrice.hidekobot.objects.fun.TriviaScore;
import java.util.Comparator;
/**
* This class gets two trivia categories, and compares them by their name.
*/
public class TriviaCategoryComparator implements Comparator<TriviaCategory> {
@Override
public int compare(TriviaCategory o1, TriviaCategory o2) {
return CharSequence.compare(o1.categoryName(), o2.categoryName());
}
}

View File

@@ -1,10 +1,8 @@
package wtf.beatrice.hidekobot.objects.comparators;
import wtf.beatrice.hidekobot.objects.TriviaScore;
import wtf.beatrice.hidekobot.objects.fun.TriviaScore;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
/**
* This class gets two trivia scores, and compares their score.

View File

@@ -1,4 +1,4 @@
package wtf.beatrice.hidekobot.objects;
package wtf.beatrice.hidekobot.objects.fun;
import wtf.beatrice.hidekobot.util.RandomUtil;

View File

@@ -0,0 +1,5 @@
package wtf.beatrice.hidekobot.objects.fun;
public record TriviaCategory(String categoryName, int categoryId) {
}

View File

@@ -1,4 +1,4 @@
package wtf.beatrice.hidekobot.objects;
package wtf.beatrice.hidekobot.objects.fun;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package wtf.beatrice.hidekobot.objects;
package wtf.beatrice.hidekobot.objects.fun;
import net.dv8tion.jda.api.entities.User;