Skip to content

Commit 76e17e0

Browse files
committed
Using real data to show swiss card!
1 parent 22188dc commit 76e17e0

File tree

15 files changed

+3444
-1779
lines changed

15 files changed

+3444
-1779
lines changed

core/displaymodels/src/commonMain/kotlin/com/adammcneilly/pocketleague/core/displaymodels/SwissTeamResultDisplayModel.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,20 @@ data class SwissTeamResultDisplayModel(
1717
)
1818

1919
fun SwissTeamResult.toDisplayModel(): SwissTeamResultDisplayModel {
20+
val gameRecord = "${this.gameWins} - ${this.gameLosses}"
21+
22+
val gameDifferential = this.gameWins - this.gameLosses
23+
val gameDifferentialString = if (gameDifferential > 0) {
24+
"+$gameDifferential"
25+
} else {
26+
gameDifferential.toString()
27+
}
28+
29+
val matchDifferential = "${this.matchWins} - ${this.matchLosses}"
30+
2031
return SwissTeamResultDisplayModel(
2132
team = this.team.toOverviewDisplayModel(),
2233
overline = "TODO",
23-
subtitle = "TODO",
34+
subtitle = "$matchDifferential | $gameRecord | $gameDifferentialString",
2435
)
2536
}

core/models/src/commonMain/kotlin/com/adammcneilly/pocketleague/core/models/SwissTeamResult.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ data class SwissTeamResult(
88
val team: Team,
99
val matchWins: Int,
1010
val matchLosses: Int,
11+
val gameWins: Int,
12+
val gameLosses: Int,
1113
)

data/startgg/src/commonMain/graphql/EventFragment.graphql

Lines changed: 0 additions & 6 deletions
This file was deleted.

data/startgg/src/commonMain/graphql/PhaseGroupQuery.graphql

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,28 @@ query PhaseGroupQuery($id: ID) {
1414
placement
1515
}
1616
}
17+
sets(
18+
page: 1,
19+
perPage: 100,
20+
sortType: NONE,
21+
filters: {}
22+
) {
23+
nodes {
24+
displayScore
25+
winnerId
26+
games {
27+
entrant1Score
28+
entrant2Score
29+
}
30+
slots {
31+
entrant {
32+
id
33+
team {
34+
...TeamFragment
35+
}
36+
}
37+
}
38+
}
39+
}
1740
}
1841
}

data/startgg/src/commonMain/graphql/SetFragment.graphql

Lines changed: 0 additions & 24 deletions
This file was deleted.

data/startgg/src/commonMain/graphql/TournamentFragment.graphql

Lines changed: 0 additions & 18 deletions
This file was deleted.

data/startgg/src/commonMain/graphql/TournamentListQuery.graphql

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)