Search in sources :

Example 6 with SzCategory

use of com.faendir.zachtronics.bot.sz.model.SzCategory in project zachtronics-leaderboard-bot by F43nd1r.

the class SzRecordDTO method fromCategoryRecord.

@NotNull
public static SzRecordDTO fromCategoryRecord(@NotNull CategoryRecord<SzRecord, SzCategory> categoryRecord) {
    SzRecord record = categoryRecord.getRecord();
    Set<SzCategory> categories = categoryRecord.getCategories();
    return new SzRecordDTO(SzScoreDTO.fromScore(record.getScore()), record.getScore().toDisplayString(DisplayContext.plainText()), record.getAuthor(), record.getDataLink(), UtilsKt.smartFormat(categories, UtilsKt.toMetricsTree(record.getPuzzle().getSupportedCategories())));
}
Also used : SzCategory(com.faendir.zachtronics.bot.sz.model.SzCategory) SzRecord(com.faendir.zachtronics.bot.sz.model.SzRecord) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

SzCategory (com.faendir.zachtronics.bot.sz.model.SzCategory)6 NotNull (org.jetbrains.annotations.NotNull)4 CategoryRecord (com.faendir.zachtronics.bot.repository.CategoryRecord)2 SzPuzzle (com.faendir.zachtronics.bot.sz.model.SzPuzzle)2 SzRecord (com.faendir.zachtronics.bot.sz.model.SzRecord)2 DisplayContext (com.faendir.zachtronics.bot.model.DisplayContext)1 SubmitResult (com.faendir.zachtronics.bot.repository.SubmitResult)1 SzScore (com.faendir.zachtronics.bot.sz.model.SzScore)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 Pattern (java.util.regex.Pattern)1 Pair (kotlin.Pair)1