Skip to content

Commit

Permalink
feat: include league in spontan group
Browse files Browse the repository at this point in the history
  • Loading branch information
1grzyb1 committed Apr 2, 2024
1 parent d29f19a commit b07ccc2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/kotlin/odyseja/odysejapka/drive/SpontanGroup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import odyseja.odysejapka.timetable.Performance
data class SpontanGroups(val group: Group, val performances: List<Performance>) {

fun groupCode(): String {
return "P${group.problem}G${group.age}"
val league = if (group.league.isNotEmpty()) group.league else " "
return "P${group.problem}G${group.age}${league}"
}

data class Group(val problem: Int, val age: Int) {
data class Group(val problem: Int, val age: Int, val league: String) {

companion object {
fun fromPerformance(performance: Performance): Group {
return Group(performance.problem, performance.age)
return Group(performance.problem, performance.age, performance.league)
}
}
}
Expand Down

0 comments on commit b07ccc2

Please sign in to comment.