From 987b73ee5abe409ca540a37c0fd48aa859d4a7cd Mon Sep 17 00:00:00 2001 From: "remi.regnault" Date: Tue, 21 May 2024 15:01:40 +0200 Subject: [PATCH] :construction: adding PlayerResumeFrame --- .../DouShouQi_App.xcodeproj/project.pbxproj | 12 +++++ .../Components/Player/PlayerResumeFrame.swift | 45 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 DouShouQi_App/DouShouQi_App/Components/Player/PlayerResumeFrame.swift diff --git a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj index 3626663..24935ce 100644 --- a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj +++ b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 645834792BF5F92600E18321 /* DouShouQi_AppUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 645834782BF5F92600E18321 /* DouShouQi_AppUITestsLaunchTests.swift */; }; 645834882BF5FEA000E18321 /* DSQ.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 645834872BF5FEA000E18321 /* DSQ.xcframework */; }; 645834892BF5FEA000E18321 /* DSQ.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 645834872BF5FEA000E18321 /* DSQ.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 645B4C202BFCCA0500FD658A /* PlayerResumeFrame.swift in Sources */ = {isa = PBXBuildFile; fileRef = 645B4C1F2BFCCA0500FD658A /* PlayerResumeFrame.swift */; }; 649ABF5B2BF60D78002E8894 /* MainMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649ABF5A2BF60D78002E8894 /* MainMenuView.swift */; }; 649ABF602BF60F2D002E8894 /* MainMenuButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649ABF5F2BF60F2D002E8894 /* MainMenuButton.swift */; }; 649B59A42BF64574002BAE38 /* TitlePageFrame.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B59A32BF64574002BAE38 /* TitlePageFrame.swift */; }; @@ -71,6 +72,7 @@ 645834782BF5F92600E18321 /* DouShouQi_AppUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DouShouQi_AppUITestsLaunchTests.swift; sourceTree = ""; }; 645834852BF5FE1400E18321 /* DouShouQi-App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "DouShouQi-App-Info.plist"; sourceTree = SOURCE_ROOT; }; 645834872BF5FEA000E18321 /* DSQ.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = DSQ.xcframework; sourceTree = ""; }; + 645B4C1F2BFCCA0500FD658A /* PlayerResumeFrame.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerResumeFrame.swift; sourceTree = ""; }; 649ABF5A2BF60D78002E8894 /* MainMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuView.swift; sourceTree = ""; }; 649ABF5F2BF60F2D002E8894 /* MainMenuButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuButton.swift; sourceTree = ""; }; 649B59A32BF64574002BAE38 /* TitlePageFrame.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitlePageFrame.swift; sourceTree = ""; }; @@ -177,6 +179,14 @@ name = Frameworks; sourceTree = ""; }; + 645B4C1C2BFCC95000FD658A /* Player */ = { + isa = PBXGroup; + children = ( + 645B4C1F2BFCCA0500FD658A /* PlayerResumeFrame.swift */, + ); + path = Player; + sourceTree = ""; + }; 649ABF592BF60D13002E8894 /* Views */ = { isa = PBXGroup; children = ( @@ -188,6 +198,7 @@ 649ABF5E2BF60ED5002E8894 /* Components */ = { isa = PBXGroup; children = ( + 645B4C1C2BFCC95000FD658A /* Player */, 649ABF5F2BF60F2D002E8894 /* MainMenuButton.swift */, 649B59A32BF64574002BAE38 /* TitlePageFrame.swift */, ); @@ -371,6 +382,7 @@ 649ABF602BF60F2D002E8894 /* MainMenuButton.swift in Sources */, 649B59B22BF65392002BAE38 /* TextStyles.swift in Sources */, 6458345C2BF5F92300E18321 /* DouShouQi_AppApp.swift in Sources */, + 645B4C202BFCCA0500FD658A /* PlayerResumeFrame.swift in Sources */, 649ABF5B2BF60D78002E8894 /* MainMenuView.swift in Sources */, 649B59A42BF64574002BAE38 /* TitlePageFrame.swift in Sources */, ); diff --git a/DouShouQi_App/DouShouQi_App/Components/Player/PlayerResumeFrame.swift b/DouShouQi_App/DouShouQi_App/Components/Player/PlayerResumeFrame.swift new file mode 100644 index 0000000..201bffb --- /dev/null +++ b/DouShouQi_App/DouShouQi_App/Components/Player/PlayerResumeFrame.swift @@ -0,0 +1,45 @@ +// +// PlayerResumeFrame.swift +// DouShouQi_App +// +// Created by Rémi REGNAULT on 21/05/2024. +// + +import SwiftUI + +struct PlayerResumeFrame: View { + + // Player Params + let Name: String + let Rank: Int + let Wins: Int + let Looses: Int + + var body: some View { + VStack { + HStack { + Text("\(Rank)") + .font(.headline) + .frame(width: 50, alignment: .trailing) + + Text(Name) + + Spacer() + + Text("\(Wins)") + .frame(width: 55, alignment: .trailing) + + Text("\(Looses)") + .frame(width: 55, alignment: .trailing) + + } + .padding(10) + } + } +} + +struct PlayerResumeFrame_Previews: PreviewProvider { + static var previews: some View { + PlayerResumeFrame(Name: "Michel Polnaref", Rank: 178, Wins: 0, Looses: 296) + } +}