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

Loading…
Cancel
Save