Skip to content

Commit f775060

Browse files
committed
Sort matches
1 parent a606d38 commit f775060

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/java/com/sunkensplashstudios/VRCRoboScout/RoboScoutAPI.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ enum class AllianceColor {
332332
}
333333

334334
enum class Round(val value: Int) {
335-
NONE(0), PRACTICE(1), QUALIFICATION(2), R128(3), R64(4), R32(5), R16(6), QUARTERFINALS(7), SEMIFINALS(8), FINALS(9)
335+
NONE(0), PRACTICE(1), QUALIFICATION(2), R128(9), R64(8), R32(7), R16(6), QUARTERFINALS(3), SEMIFINALS(4), FINALS(5)
336336
}
337337

338338
@Serializable
@@ -362,6 +362,7 @@ data class Match(
362362
val event: ShortEvent,
363363
val division: Division,
364364
val round: Int,
365+
@kotlinx.serialization.Transient val roundType: Round = Round.entries.find { it.value == round } ?: Round.NONE,
365366
val instance: Int,
366367
@SerialName("matchnum") val matchNum: Int,
367368
val scheduled: String?,
@@ -567,6 +568,8 @@ class Event {
567568
val fetchedMatch: Match = jsonWorker.decodeFromJsonElement(match)
568569
this.matches[division]!!.add(fetchedMatch)
569570
}
571+
matches[division]?.sortBy { it.instance }
572+
matches[division]?.sortBy { it.roundType }
570573
}
571574

572575
suspend fun fetchSkillsRankings() {

0 commit comments

Comments
 (0)