Search in sources :

Example 6 with IfCategory

use of com.faendir.zachtronics.bot.inf.model.IfCategory in project zachtronics-leaderboard-bot by F43nd1r.

the class IfShowCommand method findPuzzleAndCategory.

@NotNull
@Override
public Pair<IfPuzzle, IfCategory> findPuzzleAndCategory(@NotNull ShowData parameters) {
    IfPuzzle puzzle = parameters.puzzle;
    IfCategory category = parameters.category;
    if (!parameters.puzzle.getSupportedCategories().contains(category))
        throw new IllegalArgumentException("Category " + category.getDisplayName() + " does not support " + puzzle.getDisplayName());
    return new Pair<>(puzzle, category);
}
Also used : IfPuzzle(com.faendir.zachtronics.bot.inf.model.IfPuzzle) IfCategory(com.faendir.zachtronics.bot.inf.model.IfCategory) Pair(kotlin.Pair) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

IfCategory (com.faendir.zachtronics.bot.inf.model.IfCategory)6 NotNull (org.jetbrains.annotations.NotNull)4 IfPuzzle (com.faendir.zachtronics.bot.inf.model.IfPuzzle)2 IfRecord (com.faendir.zachtronics.bot.inf.model.IfRecord)2 CategoryRecord (com.faendir.zachtronics.bot.repository.CategoryRecord)2 IfScore (com.faendir.zachtronics.bot.inf.model.IfScore)1 DisplayContext (com.faendir.zachtronics.bot.model.DisplayContext)1 SubmitResult (com.faendir.zachtronics.bot.repository.SubmitResult)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 Pattern (java.util.regex.Pattern)1 Pair (kotlin.Pair)1