Laurent 1 year ago
commit f03621124a
  1. 8
      PadelClub.xcodeproj/project.pbxproj
  2. 2
      PadelClub/Data/Tournament.swift
  3. 8
      PadelClub/ViewModel/SeedInterval.swift
  4. 2
      PadelClub/Views/Match/MatchSetupView.swift
  5. 4
      PadelClub/Views/Round/RoundView.swift

@ -1960,7 +1960,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
@ -1985,7 +1985,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.4; MARKETING_VERSION = 1.0.5;
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
OTHER_SWIFT_FLAGS = "-Onone"; OTHER_SWIFT_FLAGS = "-Onone";
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
@ -2010,7 +2010,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
DEVELOPMENT_TEAM = BQ3Y44M3Q6; DEVELOPMENT_TEAM = BQ3Y44M3Q6;
@ -2033,7 +2033,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.4; MARKETING_VERSION = 1.0.5;
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-function-bodies=5 -Xfrontend -warn-long-expression-type-checking=20 -Xfrontend -warn-long-function-bodies=50"; OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-function-bodies=5 -Xfrontend -warn-long-expression-type-checking=20 -Xfrontend -warn-long-function-bodies=50";
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;

@ -1211,7 +1211,7 @@ defer {
others.forEach { round in others.forEach { round in
print("round", round.roundTitle()) print("round", round.roundTitle())
if let interval = round.seedInterval() { if let interval = round.seedInterval() {
print("interval", interval.localizedLabel()) print("interval", interval.localizedInterval())
let playedMatches = round.playedMatches().filter { $0.disabled == false || $0.isReady() } let playedMatches = round.playedMatches().filter { $0.disabled == false || $0.isReady() }
print("playedMatches", playedMatches.count) print("playedMatches", playedMatches.count)
let winners = playedMatches.compactMap({ $0.winningTeamId }).filter({ ids.contains($0) == false }) let winners = playedMatches.compactMap({ $0.winningTeamId }).filter({ ids.contains($0) == false })

@ -57,4 +57,12 @@ struct SeedInterval: Hashable, Comparable {
return "Place \(first) à \(last)" return "Place \(first) à \(last)"
} }
} }
func localizedInterval(_ displayStyle: DisplayStyle = .wide) -> String {
if dimension < 3 {
return "#\(first) / #\(last)"
} else {
return "#\(first) à #\(last)"
}
}
} }

@ -138,7 +138,7 @@ struct MatchSetupView: View {
} }
} }
} label: { } label: {
Label(seedGroup.localizedLabel(), systemImage: "dice") Label(seedGroup.localizedInterval(), systemImage: "dice")
} }
} }
} label: { } label: {

@ -123,7 +123,7 @@ struct RoundView: View {
if availableSeeds.isEmpty == false, let availableSeedGroup { if availableSeeds.isEmpty == false, let availableSeedGroup {
Section { Section {
RowButtonView("Placer \(availableSeedGroup.localizedLabel())" + ((availableSeedGroup.isFixed() == false) ? " au hasard" : "")) { RowButtonView("Placer \(availableSeedGroup.localizedInterval())" + ((availableSeedGroup.isFixed() == false) ? " au hasard" : "")) {
Task { Task {
tournament.setSeeds(inRoundIndex: upperRound.round.index, inSeedGroup: availableSeedGroup) tournament.setSeeds(inRoundIndex: upperRound.round.index, inSeedGroup: availableSeedGroup)
_save() _save()
@ -137,7 +137,7 @@ struct RoundView: View {
if (availableSeedGroup.isFixed() == false) { if (availableSeedGroup.isFixed() == false) {
Section { Section {
RowButtonView("Tirage au sort \(availableSeedGroup.localizedLabel()) visuel") { RowButtonView("Tirage au sort \(availableSeedGroup.localizedInterval()) visuel") {
self.selectedSeedGroup = availableSeedGroup self.selectedSeedGroup = availableSeedGroup
} }
} footer: { } footer: {

Loading…
Cancel
Save