fix F format

main
Razmig Sarkissian 2 weeks ago
parent e994d17946
commit c2f58e93da
  1. 41
      PadelClubData/ViewModel/PadelRule.swift

@ -1201,6 +1201,7 @@ public enum TeamPosition: Int, Identifiable, Hashable, Codable, CaseIterable {
public enum SetFormat: Int, Hashable, Codable {
case nine
case four
case three
case six
case superTieBreak
case megaTieBreak
@ -1227,6 +1228,10 @@ public enum SetFormat: Int, Hashable, Codable {
if teamOne == 5 || teamTwo == 5 {
return true
}
case .three:
if teamOne == 4 || teamTwo == 4 {
return true
}
case .six:
if teamOne == 7 || teamTwo == 7 {
return true
@ -1245,6 +1250,8 @@ public enum SetFormat: Int, Hashable, Codable {
return 8
case .four:
return 4
case .three:
return 3
case .six:
return 6
case .superTieBreak, .megaTieBreak:
@ -1262,6 +1269,10 @@ public enum SetFormat: Int, Hashable, Codable {
if teamOneScore == 4 {
return []
}
case .three:
if teamOneScore == 3 {
return []
}
case .six:
if teamOneScore == 6 {
return []
@ -1284,6 +1295,8 @@ public enum SetFormat: Int, Hashable, Codable {
return [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
case .four:
return [5, 4, 3, 2, 1, 0]
case .three:
return [4, 3, 2, 1, 0]
case .six:
return [7, 6, 5, 4, 3, 2, 1, 0]
case .superTieBreak:
@ -1299,6 +1312,8 @@ public enum SetFormat: Int, Hashable, Codable {
return 9
case .four:
return 4
case .three:
return 3
case .six:
return 6
case .superTieBreak:
@ -1366,15 +1381,15 @@ public enum MatchFormat: Int, Hashable, Codable, CaseIterable, Identifiable {
return 2
case .nineGames, .nineGamesDecisivePoint:
return 3
case .superTie:
case .singleSetOfFourGames, .singleSetOfFourGamesDecisivePoint:
return 4
case .megaTie:
case .superTie:
return 5
case .twoSetsOfSuperTie:
case .megaTie:
return 6
case .singleSet, .singleSetDecisivePoint:
case .twoSetsOfSuperTie:
return 7
case .singleSetOfFourGames, .singleSetOfFourGamesDecisivePoint:
case .singleSet, .singleSetDecisivePoint:
return 8
}
}
@ -1397,15 +1412,15 @@ public enum MatchFormat: Int, Hashable, Codable, CaseIterable, Identifiable {
return 3
case .nineGamesDecisivePoint:
return 3
case .superTie:
case .singleSetOfFourGames, .singleSetOfFourGamesDecisivePoint:
return 4
case .megaTie:
case .superTie:
return 5
case .twoSetsOfSuperTie:
case .megaTie:
return 6
case .singleSet, .singleSetDecisivePoint:
case .twoSetsOfSuperTie:
return 7
case .singleSetOfFourGames, .singleSetOfFourGamesDecisivePoint:
case .singleSet, .singleSetDecisivePoint:
return 8
}
}
@ -1643,7 +1658,7 @@ public enum MatchFormat: Int, Hashable, Codable, CaseIterable, Identifiable {
case .megaTie:
return "supertie de 15 points"
case .singleSetOfFourGames, .singleSetOfFourGamesDecisivePoint:
return "1 set de 4 jeux, tiebreak à 4/4"
return "1 set de 4 jeux, tiebreak à 3/3"
}
}
@ -1672,8 +1687,10 @@ public enum MatchFormat: Int, Hashable, Codable, CaseIterable, Identifiable {
switch self {
case .twoSets, .twoSetsSuperTie, .twoSetsDecisivePoint, .twoSetsDecisivePointSuperTie, .singleSet, .singleSetDecisivePoint:
return .six
case .twoSetsOfFourGames, .twoSetsOfFourGamesDecisivePoint, .singleSetOfFourGames, .singleSetOfFourGamesDecisivePoint:
case .twoSetsOfFourGames, .twoSetsOfFourGamesDecisivePoint:
return .four
case .singleSetOfFourGames, .singleSetOfFourGamesDecisivePoint:
return .three
case .nineGames, .nineGamesDecisivePoint:
return .nine
case .superTie, .twoSetsOfSuperTie:

Loading…
Cancel
Save