Add(PartyEnregistery): vu des party en registerer avec un stub #21

Merged
louis.dufour merged 1 commits from PartyEnregistery into dev 11 months ago

@ -7,12 +7,12 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
16820AB62C09C06A00C7F360 /* ItemCollectionParty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16820AB52C09C06A00C7F360 /* ItemCollectionParty.swift */; };
16820AB92C09C81500C7F360 /* PartyEnregistery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16820AB82C09C81500C7F360 /* PartyEnregistery.swift */; };
16820ABB2C09C85000C7F360 /* Stub.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16820ABA2C09C85000C7F360 /* Stub.swift */; };
82CE59E92C045D1100ADEE24 /* GameScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59E82C045D1100ADEE24 /* GameScene.swift */; }; 82CE59E92C045D1100ADEE24 /* GameScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59E82C045D1100ADEE24 /* GameScene.swift */; };
82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59EA2C045E3800ADEE24 /* GameView.swift */; }; 82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59EA2C045E3800ADEE24 /* GameView.swift */; };
82CE59EF2C0460E500ADEE24 /* SpriteMoople.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59EE2C0460E500ADEE24 /* SpriteMoople.swift */; }; 82CE59EF2C0460E500ADEE24 /* SpriteMoople.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59EE2C0460E500ADEE24 /* SpriteMoople.swift */; };
82F9D3312BFE3A9F009EDFAF /* HistoryGameDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F9D3302BFE3A9F009EDFAF /* HistoryGameDetail.swift */; };
82F9D3332BFE3B12009EDFAF /* HistoryHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F9D3322BFE3B12009EDFAF /* HistoryHeader.swift */; };
82F9D3362BFE3B3C009EDFAF /* HistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F9D3352BFE3B3C009EDFAF /* HistoryView.swift */; };
C20310D62BFCB5FB0031657D /* PickerComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D52BFCB5FB0031657D /* PickerComponent.swift */; }; C20310D62BFCB5FB0031657D /* PickerComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D52BFCB5FB0031657D /* PickerComponent.swift */; };
C20310D82BFCC2410031657D /* GeneralParametersMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */; }; C20310D82BFCC2410031657D /* GeneralParametersMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */; };
C20310DA2BFCC8600031657D /* ToggleComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D92BFCC8600031657D /* ToggleComponent.swift */; }; C20310DA2BFCC8600031657D /* ToggleComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D92BFCC8600031657D /* ToggleComponent.swift */; };
@ -51,12 +51,12 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
16820AB52C09C06A00C7F360 /* ItemCollectionParty.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemCollectionParty.swift; sourceTree = "<group>"; };
16820AB82C09C81500C7F360 /* PartyEnregistery.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartyEnregistery.swift; sourceTree = "<group>"; };
16820ABA2C09C85000C7F360 /* Stub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Stub.swift; sourceTree = "<group>"; };
82CE59E82C045D1100ADEE24 /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = "<group>"; }; 82CE59E82C045D1100ADEE24 /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = "<group>"; };
82CE59EA2C045E3800ADEE24 /* GameView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameView.swift; sourceTree = "<group>"; }; 82CE59EA2C045E3800ADEE24 /* GameView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameView.swift; sourceTree = "<group>"; };
82CE59EE2C0460E500ADEE24 /* SpriteMoople.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpriteMoople.swift; sourceTree = "<group>"; }; 82CE59EE2C0460E500ADEE24 /* SpriteMoople.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpriteMoople.swift; sourceTree = "<group>"; };
82F9D3302BFE3A9F009EDFAF /* HistoryGameDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryGameDetail.swift; sourceTree = "<group>"; };
82F9D3322BFE3B12009EDFAF /* HistoryHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryHeader.swift; sourceTree = "<group>"; };
82F9D3352BFE3B3C009EDFAF /* HistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryView.swift; sourceTree = "<group>"; };
C20310D52BFCB5FB0031657D /* PickerComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickerComponent.swift; sourceTree = "<group>"; }; C20310D52BFCB5FB0031657D /* PickerComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickerComponent.swift; sourceTree = "<group>"; };
C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralParametersMenuView.swift; sourceTree = "<group>"; }; C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralParametersMenuView.swift; sourceTree = "<group>"; };
C20310D92BFCC8600031657D /* ToggleComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleComponent.swift; sourceTree = "<group>"; }; C20310D92BFCC8600031657D /* ToggleComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleComponent.swift; sourceTree = "<group>"; };
@ -105,6 +105,15 @@
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
16820AB72C09C7B700C7F360 /* PartyEnregistery */ = {
isa = PBXGroup;
children = (
16820ABA2C09C85000C7F360 /* Stub.swift */,
16820AB82C09C81500C7F360 /* PartyEnregistery.swift */,
);
path = PartyEnregistery;
sourceTree = "<group>";
};
8203E9052BF60117005F5C4A /* Frameworks */ = { 8203E9052BF60117005F5C4A /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -130,16 +139,6 @@
path = SKNodes; path = SKNodes;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
82F9D32F2BFE3A75009EDFAF /* History */ = {
isa = PBXGroup;
children = (
82F9D3302BFE3A9F009EDFAF /* HistoryGameDetail.swift */,
82F9D3322BFE3B12009EDFAF /* HistoryHeader.swift */,
82F9D3352BFE3B3C009EDFAF /* HistoryView.swift */,
);
path = History;
sourceTree = "<group>";
};
C205A2AA2BF373360097BD93 = { C205A2AA2BF373360097BD93 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -176,12 +175,12 @@
C205A2BC2BF373380097BD93 /* Views */ = { C205A2BC2BF373380097BD93 /* Views */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
16820AB72C09C7B700C7F360 /* PartyEnregistery */,
C24DAB5A2C061DAA00681CD0 /* Enum */, C24DAB5A2C061DAA00681CD0 /* Enum */,
C25220F02C00AD7F0026B71F /* Components */, C25220F02C00AD7F0026B71F /* Components */,
C25220EC2C00AC530026B71F /* GameParametersMenu */, C25220EC2C00AC530026B71F /* GameParametersMenu */,
C25220EB2C00A9230026B71F /* GeneralParametersMenu */, C25220EB2C00A9230026B71F /* GeneralParametersMenu */,
C25220EA2C00A9010026B71F /* MainMenu */, C25220EA2C00A9010026B71F /* MainMenu */,
82F9D32F2BFE3A75009EDFAF /* History */,
C205A2BD2BF373380097BD93 /* Preview Assets.xcassets */, C205A2BD2BF373380097BD93 /* Preview Assets.xcassets */,
); );
path = Views; path = Views;
@ -262,6 +261,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C2F3940A2C0463940070B4F6 /* ProfileComponent.swift */, C2F3940A2C0463940070B4F6 /* ProfileComponent.swift */,
16820AB52C09C06A00C7F360 /* ItemCollectionParty.swift */,
); );
path = Visuals; path = Visuals;
sourceTree = "<group>"; sourceTree = "<group>";
@ -397,21 +397,21 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
C205A2B92BF373360097BD93 /* ContentView.swift in Sources */, C205A2B92BF373360097BD93 /* ContentView.swift in Sources */,
16820ABB2C09C85000C7F360 /* Stub.swift in Sources */,
82CE59EF2C0460E500ADEE24 /* SpriteMoople.swift in Sources */, 82CE59EF2C0460E500ADEE24 /* SpriteMoople.swift in Sources */,
82CE59E92C045D1100ADEE24 /* GameScene.swift in Sources */, 82CE59E92C045D1100ADEE24 /* GameScene.swift in Sources */,
82F9D3312BFE3A9F009EDFAF /* HistoryGameDetail.swift in Sources */,
C24659E92BF60FAA004E80D5 /* ButtonComponent.swift in Sources */, C24659E92BF60FAA004E80D5 /* ButtonComponent.swift in Sources */,
C24DAB5E2C061E3A00681CD0 /* Language.swift in Sources */, C24DAB5E2C061E3A00681CD0 /* Language.swift in Sources */,
C2F394082C0462400070B4F6 /* PhotoButtonComponent.swift in Sources */, C2F394082C0462400070B4F6 /* PhotoButtonComponent.swift in Sources */,
C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */, C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */,
82F9D3362BFE3B3C009EDFAF /* HistoryView.swift in Sources */,
C20310D82BFCC2410031657D /* GeneralParametersMenuView.swift in Sources */, C20310D82BFCC2410031657D /* GeneralParametersMenuView.swift in Sources */,
C2F3940B2C0463940070B4F6 /* ProfileComponent.swift in Sources */, C2F3940B2C0463940070B4F6 /* ProfileComponent.swift in Sources */,
16820AB62C09C06A00C7F360 /* ItemCollectionParty.swift in Sources */,
16820AB92C09C81500C7F360 /* PartyEnregistery.swift in Sources */,
C205A2B72BF373360097BD93 /* ArkitDoushiQiApp.swift in Sources */, C205A2B72BF373360097BD93 /* ArkitDoushiQiApp.swift in Sources */,
C24DAB5C2C061DC700681CD0 /* AI.swift in Sources */, C24DAB5C2C061DC700681CD0 /* AI.swift in Sources */,
C25220F32C00AF490026B71F /* EditComponent.swift in Sources */, C25220F32C00AF490026B71F /* EditComponent.swift in Sources */,
C20310D62BFCB5FB0031657D /* PickerComponent.swift in Sources */, C20310D62BFCB5FB0031657D /* PickerComponent.swift in Sources */,
82F9D3332BFE3B12009EDFAF /* HistoryHeader.swift in Sources */,
82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */, 82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */,
C20310DA2BFCC8600031657D /* ToggleComponent.swift in Sources */, C20310DA2BFCC8600031657D /* ToggleComponent.swift in Sources */,
C25220EE2C00AC7E0026B71F /* GameParametersMenuView.swift in Sources */, C25220EE2C00AC7E0026B71F /* GameParametersMenuView.swift in Sources */,

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Perceval.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 KiB

@ -0,0 +1,92 @@
//
// ItemCollectionParty.swift
// ArkitDoushiQi
//
// Created by Louis DUFOUR on 31/05/2024.
//
import SwiftUI
struct ItemCollectionParty: View {
var party: Party
var body: some View {
VStack {
HStack {
Text(party.date)
.font(.headline)
.foregroundColor(.gray)
Spacer()
}
.padding(.bottom, 5)
GeometryReader { geometry in
HStack(spacing: 10) {
HStack {
Image(party.player1Image)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: geometry.size.width * 0.15, height: geometry.size.width * 0.15)
.clipShape(Circle())
.overlay(Circle().stroke(Color.purple, lineWidth: 2))
VStack(alignment: .leading) {
Text(party.player1Name)
.fontWeight(.bold)
.foregroundColor(.purple)
.lineLimit(1)
.minimumScaleFactor(0.5)
.frame(maxWidth: geometry.size.width * 0.25, alignment: .leading)
Text("\(party.player1Score)")
.font(.largeTitle)
.fontWeight(.bold)
.foregroundColor(.green) // Gagnant en vert
}
}
Text("vs")
.font(.headline)
.foregroundColor(.gray)
HStack {
VStack(alignment: .trailing) {
Text(party.player2Name)
.fontWeight(.bold)
.foregroundColor(.purple)
.lineLimit(1)
.minimumScaleFactor(0.5)
.frame(maxWidth: geometry.size.width * 0.25, alignment: .trailing)
Text("\(party.player2Score)")
.font(.largeTitle)
.fontWeight(.bold)
.foregroundColor(.red) // Perdant en rouge
}
Image(party.player2Image)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: geometry.size.width * 0.15, height: geometry.size.width * 0.15)
.clipShape(Circle())
.overlay(Circle().stroke(Color.purple, lineWidth: 2))
}
}
.padding()
.background(Color.white)
.cornerRadius(15)
.shadow(radius: 3) // Réduction de l'ombre pour un effet plus léger
}
.frame(height: 120) // Ajustez la hauteur en fonction de votre contenu
}
.padding(.horizontal)
}
}
struct ItemCollectionParty_Previews: PreviewProvider {
static var previews: some View {
ItemCollectionParty(party: Party(player1Name: "L'invaincu du samedi", player1Score: 2, player1Image: "Perceval", player2Name: "Le gars du dimanche", player2Score: 1, player2Image: "Perceval", date: "Samedi soir"))
.previewLayout(.sizeThatFits)
.padding()
}
}

@ -1,33 +0,0 @@
//
// DetailGameHistory.swift
// ArkitDoushiQi
//
// Created by Enzo JOLYS on 22/05/2024.
//
import SwiftUI
import DouShouQiModel
struct HistoryGameDetail: View {
let game:Game
var body: some View {
ZStack(){
Color.red
Color.gray
HStack(){
Text(game.players[.player1]?.name ?? "Inconnu")
Text(" VS ")
Text(game.players[.player2]?.name ?? "Inconnu")
Spacer()
}
}
}
}
struct HistoryGameDetail_Previews: PreviewProvider {
static var previews: some View {
HistoryGameDetail(game: try! Game(withRules: VerySimpleRules(), andPlayer1: Player(withName: "Joueur 1 ", andId: .player1)!, andPlayer2: Player(withName: "Joueur 2 ", andId: .player2)!))
}
}

@ -1,24 +0,0 @@
//
// EnteteHistory.swift
// ArkitDoushiQi
//
// Created by Enzo JOLYS on 22/05/2024.
//
import SwiftUI
struct HistoryHeader: View {
var body: some View {
HStack(){
Spacer()
Text("Historique !")
Spacer()
}
}
}
struct HistoryHeader_Previews: PreviewProvider {
static var previews: some View {
HistoryHeader()
}
}

@ -1,31 +0,0 @@
//
// History.swift
// ArkitDoushiQi
//
// Created by Enzo JOLYS on 22/05/2024.
//
import SwiftUI
import DouShouQiModel
struct HistoryView: View {
var listGame:[Game] = try! [Game(withRules: VerySimpleRules(), andPlayer1: Player(withName: "Player 1 ", andId: .player1)!, andPlayer2: Player(withName: "Player 2 ", andId: .player2)!)]
var body: some View {
VStack(){
HistoryHeader()
NavigationStack {
List(listGame, id: \.board){ game in
HistoryGameDetail(game: game)
}
}
}
}
}
struct HistoryView_Previews: PreviewProvider {
static var previews: some View {
HistoryView()
}
}

@ -29,7 +29,7 @@ struct MainMenu: View {
{ GameParametersMenuView() } { GameParametersMenuView() }
Spacer().frame(height: 30) Spacer().frame(height: 30)
ButtonComponent(title: registeredGamesButtonText) ButtonComponent(title: registeredGamesButtonText)
{ Text("parties enregistrées page") } { PartyListView() }
Spacer().frame(height: 30) Spacer().frame(height: 30)
ButtonComponent(title: ParametersButtontText) ButtonComponent(title: ParametersButtontText)
{ GeneralParametersMenuView( { GeneralParametersMenuView(

@ -0,0 +1,34 @@
//
// PartyEnregistery.swift
// ArkitDoushiQi
//
// Created by Louis DUFOUR on 31/05/2024.
//
import SwiftUI
import SwiftUI
struct PartyListView: View {
let parties: [Party] = [
Party(player1Name: "L'invaincu du samedi", player1Score: 2, player1Image: "Perceval", player2Name: "Le gars du dimanche", player2Score: 1, player2Image: "Perceval", date: "Samedi soir"),
Party(player1Name: "Le champion du vendredi", player1Score: 3, player1Image: "Perceval", player2Name: "Le perdant du lundi", player2Score: 0, player2Image: "Perceval", date: "Vendredi soir")
// Ajoutez plus de parties ici
]
var body: some View {
NavigationView {
List(parties) { party in
ItemCollectionParty(party: party)
.padding(.vertical, 5)
}
.navigationTitle("Liste des Parties")
}
}
}
struct PartyListView_Previews: PreviewProvider {
static var previews: some View {
PartyListView()
}
}

@ -0,0 +1,19 @@
//
// Stub.swift
// ArkitDoushiQi
//
// Created by Louis DUFOUR on 31/05/2024.
//
import SwiftUI
struct Party: Identifiable {
let id = UUID()
let player1Name: String
let player1Score: Int
let player1Image: String
let player2Name: String
let player2Score: Int
let player2Image: String
let date: String
}
Loading…
Cancel
Save