|
|
|
@ -6,8 +6,10 @@
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
import DouShouQiModel
|
|
|
|
|
|
|
|
|
|
struct PlayerListView: View {
|
|
|
|
|
var playerStub : StubbedPlayers = StubbedPlayers()
|
|
|
|
|
var body: some View {
|
|
|
|
|
//NavigationStack {
|
|
|
|
|
ZStack {
|
|
|
|
@ -16,13 +18,36 @@ struct PlayerListView: View {
|
|
|
|
|
/*Text("Classement des joueurs")
|
|
|
|
|
.scaleEffect(1.75)*/
|
|
|
|
|
|
|
|
|
|
List(playerStub.getStubbedPlayer()) { player in
|
|
|
|
|
NavigationLink {
|
|
|
|
|
PlayerView(age: 18, winLossRatio: 1.0, gamesPlayed: 10, wins: 5, losses: 5, histoMatches: [
|
|
|
|
|
Match(gameEndScreen: "opponent1", opponent: "Opponent 1", selfScore: 3, opScore: 2),
|
|
|
|
|
Match(gameEndScreen: "opponent2", opponent: "Opponent 2", selfScore: 1, opScore: 3),
|
|
|
|
|
Match(gameEndScreen: "opponent3", opponent: "Opponent 3", selfScore: 2, opScore: 2)
|
|
|
|
|
],
|
|
|
|
|
playerVm: player) //mettre player plus tard
|
|
|
|
|
} label:{Text("pif")}
|
|
|
|
|
}.navigationDestination(for: String.self) { name in
|
|
|
|
|
PlayerView(age: 18, winLossRatio: 1.0, gamesPlayed: 10, wins: 5, losses: 5, histoMatches: [
|
|
|
|
|
Match(gameEndScreen: "opponent1", opponent: "Opponent 1", selfScore: 3, opScore: 2),
|
|
|
|
|
Match(gameEndScreen: "opponent2", opponent: "Opponent 2", selfScore: 1, opScore: 3),
|
|
|
|
|
Match(gameEndScreen: "opponent3", opponent: "Opponent 3", selfScore: 2, opScore: 2)
|
|
|
|
|
],
|
|
|
|
|
playerVm: PlayerVM(with: Player(withName: "Toto", andId: .player2)!)) //mettre player plus tard
|
|
|
|
|
}
|
|
|
|
|
.navigationTitle("Leaderboard")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List {
|
|
|
|
|
NavigationLink{
|
|
|
|
|
PlayerView(name: "Billy", age: 18, winLossRatio: 1.0, gamesPlayed: 10, wins: 5, losses: 5, histoMatches: [
|
|
|
|
|
Match(gameEndScreen: "opponent1", opponent: "Opponent 1", score: "3-2", result: "Victoire"),
|
|
|
|
|
Match(gameEndScreen: "opponent2", opponent: "Opponent 2", score: "1-3", result: "Défaite"),
|
|
|
|
|
Match(gameEndScreen: "opponent3", opponent: "Opponent 3", score: "2-2", result: "Nul")
|
|
|
|
|
]) //mettre player plus tard
|
|
|
|
|
PlayerView(age: 18, winLossRatio: 1.0, gamesPlayed: 10, wins: 5, losses: 5, histoMatches: [
|
|
|
|
|
Match(gameEndScreen: "opponent1", opponent: "Opponent 1", selfScore: 3, opScore: 2),
|
|
|
|
|
Match(gameEndScreen: "opponent2", opponent: "Opponent 2", selfScore: 1, opScore: 3),
|
|
|
|
|
Match(gameEndScreen: "opponent3", opponent: "Opponent 3", selfScore: 2, opScore: 2)
|
|
|
|
|
],
|
|
|
|
|
playerVm: PlayerVM(with: Player(withName: "Billy", andId: .player2)!)) //mettre player plus tard
|
|
|
|
|
|
|
|
|
|
} label:{Text("pif")}
|
|
|
|
|
|
|
|
|
@ -31,11 +56,12 @@ struct PlayerListView: View {
|
|
|
|
|
NavigationLink("Bromingo", value: "Bromingo")
|
|
|
|
|
}
|
|
|
|
|
.navigationDestination(for: String.self) { name in
|
|
|
|
|
PlayerView(name: name, age: 18, winLossRatio: 1.0, gamesPlayed: 10, wins: 5, losses: 5, histoMatches: [
|
|
|
|
|
Match(gameEndScreen: "opponent1", opponent: "Opponent 1", score: "3-2", result: "Victoire"),
|
|
|
|
|
Match(gameEndScreen: "opponent2", opponent: "Opponent 2", score: "1-3", result: "Défaite"),
|
|
|
|
|
Match(gameEndScreen: "opponent3", opponent: "Opponent 3", score: "2-2", result: "Nul")
|
|
|
|
|
]) //mettre player plus tard
|
|
|
|
|
PlayerView(age: 18, winLossRatio: 1.0, gamesPlayed: 10, wins: 5, losses: 5, histoMatches: [
|
|
|
|
|
Match(gameEndScreen: "opponent1", opponent: "Opponent 1", selfScore: 3, opScore: 2),
|
|
|
|
|
Match(gameEndScreen: "opponent2", opponent: "Opponent 2", selfScore: 1, opScore: 3),
|
|
|
|
|
Match(gameEndScreen: "opponent3", opponent: "Opponent 3", selfScore: 2, opScore: 2)
|
|
|
|
|
],
|
|
|
|
|
playerVm: PlayerVM(with: Player(withName: "Toto", andId: .player2)!)) //mettre player plus tard
|
|
|
|
|
}
|
|
|
|
|
.navigationTitle("Leaderboard")
|
|
|
|
|
}
|
|
|
|
|