diff --git a/PadelClub/Views/Tournament/Screen/Components/HeadManagerView.swift b/PadelClub/Views/Tournament/Screen/Components/HeadManagerView.swift index 3fa4ed0..5e5ccf4 100644 --- a/PadelClub/Views/Tournament/Screen/Components/HeadManagerView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/HeadManagerView.swift @@ -62,7 +62,9 @@ struct HeadManagerView: View { } while leftToPlace(heads: heads, teamsPerRound: teamsPerRound) > 0 { // maxAssignable: On retire toutes les équipes placées dans les tours précédents, pondérées par leur propagation (puissance du tour) - let headsLeft = heads - teamsPerRound.reduce(0, +) + let alreadyPut = teamsPerRound.reduce(0, +) + let headsLeft = alreadyPut == 0 ? teamsInBracket : heads - alreadyPut + // Calculate how many teams from previous rounds propagate to this round let currentRound = teamsPerRound.count var previousTeams = 0 @@ -150,7 +152,7 @@ struct HeadManagerView: View { } result = RoundRule.cumulatedNumberOfMatches(forTeams: count) } - + print(index, value, result, count) return result } .reduce(0, +) diff --git a/PadelClub/Views/Tournament/Screen/Components/TournamentMatchFormatsSettingsView.swift b/PadelClub/Views/Tournament/Screen/Components/TournamentMatchFormatsSettingsView.swift index d4280a0..3dcc1a4 100644 --- a/PadelClub/Views/Tournament/Screen/Components/TournamentMatchFormatsSettingsView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/TournamentMatchFormatsSettingsView.swift @@ -25,12 +25,10 @@ struct TournamentMatchFormatsSettingsView: View { var body: some View { @Bindable var tournament = tournament List { - if confirmUpdate { - RowButtonView("Modifier les matchs existants", role: .destructive) { - _updateAllFormat() - } + RowButtonView("Modifier les matchs existants", role: .destructive) { + _updateAllFormat() } - + TournamentFormatSelectionView() Section { diff --git a/PadelClub/Views/Tournament/Screen/TableStructureView.swift b/PadelClub/Views/Tournament/Screen/TableStructureView.swift index bc20363..82f3436 100644 --- a/PadelClub/Views/Tournament/Screen/TableStructureView.swift +++ b/PadelClub/Views/Tournament/Screen/TableStructureView.swift @@ -691,6 +691,10 @@ struct TableStructureView: View { let seedSorted = frenchUmpireOrder(for: numberOfMatches).filter({ index in playedMatches.contains(index) }).prefix(seedCount) + + if playedMatches.count == numberOfMatches && seedCount == numberOfMatches * 2 { + continue + } for (index, value) in seedSorted.enumerated() { let isOpponentTurn = index >= playedMatches.count if let match = allMatches[safe:value] {