Fix FightStatistics

Signed-off-by: Chaoscaot <max@maxsp.de>
This commit is contained in:
2025-11-30 16:09:40 +01:00
parent 3970f21999
commit ede7df82f3
@@ -151,9 +151,9 @@ class EventFight(id: EntityID<Int>) : IntEntity(id), Comparable<EventFight> {
val dependents by lazy { useDb { EventRelation.getFightRelations(this@EventFight).toList() } }
val winner: Team?
get() = if (ergebnis == 1) Team[teamBlue] else if (ergebnis == 2) Team[teamRed] else null
get() = useDb { if (ergebnis == 1) Team[teamBlue] else if (ergebnis == 2) Team[teamRed] else null }
val losser: Team?
get() = if (ergebnis == 1) Team[teamRed] else if (ergebnis == 2) Team[teamBlue] else null
get() = useDb { if (ergebnis == 1) Team[teamRed] else if (ergebnis == 2) Team[teamBlue] else null }
fun setGroup(group: Int?) = useDb { groupId = group?.let { EntityID(it, EventGroupTable) } }
fun hasFinished() = fight != null || ergebnis != 0