use of com.faendir.zachtronics.bot.sz.model.SzPuzzle in project zachtronics-leaderboard-bot by F43nd1r.
the class SzController method getRecord.
@Override
public SzRecordDTO getRecord(@NotNull String puzzleId, @NotNull String categoryId) {
SzPuzzle puzzle = findPuzzle(puzzleId);
SzCategory category = findCategory(categoryId);
SzRecord record = repository.find(puzzle, category);
if (record != null)
return SzRecordDTO.fromCategoryRecord(new CategoryRecord<>(record, EnumSet.of(category)));
else
return null;
}
use of com.faendir.zachtronics.bot.sz.model.SzPuzzle in project zachtronics-leaderboard-bot by F43nd1r.
the class SzShowCommand method findPuzzleAndCategory.
@NotNull
@Override
public Pair<SzPuzzle, SzCategory> findPuzzleAndCategory(@NotNull ShowData parameters) {
SzPuzzle puzzle = parameters.puzzle;
SzCategory 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);
}
Aggregations