Update(ParametersMenuView) : Add several #15

Merged
johan.lachenal merged 1 commits from ParametersMenuView into dev 11 months ago

@ -7,12 +7,12 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
82F9D3312BFE3A9F009EDFAF /* DetailGameHistory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F9D3302BFE3A9F009EDFAF /* DetailGameHistory.swift */; }; 82F9D3312BFE3A9F009EDFAF /* HistoryGameDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F9D3302BFE3A9F009EDFAF /* HistoryGameDetail.swift */; };
82F9D3332BFE3B12009EDFAF /* EnteteHistory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F9D3322BFE3B12009EDFAF /* EnteteHistory.swift */; }; 82F9D3332BFE3B12009EDFAF /* HistoryHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F9D3322BFE3B12009EDFAF /* HistoryHeader.swift */; };
82F9D3362BFE3B3C009EDFAF /* History.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F9D3352BFE3B3C009EDFAF /* History.swift */; }; 82F9D3362BFE3B3C009EDFAF /* HistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F9D3352BFE3B3C009EDFAF /* HistoryView.swift */; };
C20310D62BFCB5FB0031657D /* DoushiQiPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D52BFCB5FB0031657D /* DoushiQiPicker.swift */; }; C20310D62BFCB5FB0031657D /* PickerComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D52BFCB5FB0031657D /* PickerComponent.swift */; };
C20310D82BFCC2410031657D /* ParametersMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D72BFCC2410031657D /* ParametersMenuView.swift */; }; C20310D82BFCC2410031657D /* GeneralParametersMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */; };
C20310DA2BFCC8600031657D /* ToggleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D92BFCC8600031657D /* ToggleView.swift */; }; C20310DA2BFCC8600031657D /* ToggleComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D92BFCC8600031657D /* ToggleComponent.swift */; };
C205A2B72BF373360097BD93 /* ArkitDoushiQiApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2B62BF373360097BD93 /* ArkitDoushiQiApp.swift */; }; C205A2B72BF373360097BD93 /* ArkitDoushiQiApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2B62BF373360097BD93 /* ArkitDoushiQiApp.swift */; };
C205A2B92BF373360097BD93 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2B82BF373360097BD93 /* ContentView.swift */; }; C205A2B92BF373360097BD93 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2B82BF373360097BD93 /* ContentView.swift */; };
C205A2BB2BF373380097BD93 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C205A2BA2BF373380097BD93 /* Assets.xcassets */; }; C205A2BB2BF373380097BD93 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C205A2BA2BF373380097BD93 /* Assets.xcassets */; };
@ -21,7 +21,7 @@
C205A2D22BF373380097BD93 /* WtaTennisUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2D12BF373380097BD93 /* WtaTennisUITests.swift */; }; C205A2D22BF373380097BD93 /* WtaTennisUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2D12BF373380097BD93 /* WtaTennisUITests.swift */; };
C205A2D42BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2D32BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift */; }; C205A2D42BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2D32BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift */; };
C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24659E42BF5FE09004E80D5 /* MainMenu.swift */; }; C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24659E42BF5FE09004E80D5 /* MainMenu.swift */; };
C24659E92BF60FAA004E80D5 /* MainMenuButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24659E82BF60FAA004E80D5 /* MainMenuButton.swift */; }; C24659E92BF60FAA004E80D5 /* MainMenuButtonComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24659E82BF60FAA004E80D5 /* MainMenuButtonComponent.swift */; };
C2F417702BFE2FBE00CFF0B3 /* howto.md in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176C2BFE2FBD00CFF0B3 /* howto.md */; }; C2F417702BFE2FBE00CFF0B3 /* howto.md in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176C2BFE2FBD00CFF0B3 /* howto.md */; };
C2F417722BFE2FBE00CFF0B3 /* capture.png in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176E2BFE2FBD00CFF0B3 /* capture.png */; }; C2F417722BFE2FBE00CFF0B3 /* capture.png in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176E2BFE2FBD00CFF0B3 /* capture.png */; };
C2F417732BFE2FBE00CFF0B3 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176F2BFE2FBD00CFF0B3 /* README.md */; }; C2F417732BFE2FBE00CFF0B3 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176F2BFE2FBD00CFF0B3 /* README.md */; };
@ -45,12 +45,12 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
82F9D3302BFE3A9F009EDFAF /* DetailGameHistory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailGameHistory.swift; sourceTree = "<group>"; }; 82F9D3302BFE3A9F009EDFAF /* HistoryGameDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryGameDetail.swift; sourceTree = "<group>"; };
82F9D3322BFE3B12009EDFAF /* EnteteHistory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnteteHistory.swift; sourceTree = "<group>"; }; 82F9D3322BFE3B12009EDFAF /* HistoryHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryHeader.swift; sourceTree = "<group>"; };
82F9D3352BFE3B3C009EDFAF /* History.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = History.swift; sourceTree = "<group>"; }; 82F9D3352BFE3B3C009EDFAF /* HistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryView.swift; sourceTree = "<group>"; };
C20310D52BFCB5FB0031657D /* DoushiQiPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DoushiQiPicker.swift; sourceTree = "<group>"; }; C20310D52BFCB5FB0031657D /* PickerComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickerComponent.swift; sourceTree = "<group>"; };
C20310D72BFCC2410031657D /* ParametersMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParametersMenuView.swift; sourceTree = "<group>"; }; C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralParametersMenuView.swift; sourceTree = "<group>"; };
C20310D92BFCC8600031657D /* ToggleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleView.swift; sourceTree = "<group>"; }; C20310D92BFCC8600031657D /* ToggleComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleComponent.swift; sourceTree = "<group>"; };
C205A2B32BF373360097BD93 /* ArkitDoushiQi.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ArkitDoushiQi.app; sourceTree = BUILT_PRODUCTS_DIR; }; C205A2B32BF373360097BD93 /* ArkitDoushiQi.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ArkitDoushiQi.app; sourceTree = BUILT_PRODUCTS_DIR; };
C205A2B62BF373360097BD93 /* ArkitDoushiQiApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArkitDoushiQiApp.swift; sourceTree = "<group>"; }; C205A2B62BF373360097BD93 /* ArkitDoushiQiApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArkitDoushiQiApp.swift; sourceTree = "<group>"; };
C205A2B82BF373360097BD93 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; }; C205A2B82BF373360097BD93 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
@ -62,7 +62,7 @@
C205A2D12BF373380097BD93 /* WtaTennisUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WtaTennisUITests.swift; sourceTree = "<group>"; }; C205A2D12BF373380097BD93 /* WtaTennisUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WtaTennisUITests.swift; sourceTree = "<group>"; };
C205A2D32BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WtaTennisUITestsLaunchTests.swift; sourceTree = "<group>"; }; C205A2D32BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WtaTennisUITestsLaunchTests.swift; sourceTree = "<group>"; };
C24659E42BF5FE09004E80D5 /* MainMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenu.swift; sourceTree = "<group>"; }; C24659E42BF5FE09004E80D5 /* MainMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenu.swift; sourceTree = "<group>"; };
C24659E82BF60FAA004E80D5 /* MainMenuButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuButton.swift; sourceTree = "<group>"; }; C24659E82BF60FAA004E80D5 /* MainMenuButtonComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuButtonComponent.swift; sourceTree = "<group>"; };
C2F4176C2BFE2FBD00CFF0B3 /* howto.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = howto.md; sourceTree = "<group>"; }; C2F4176C2BFE2FBD00CFF0B3 /* howto.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = howto.md; sourceTree = "<group>"; };
C2F4176D2BFE2FBD00CFF0B3 /* DSQ.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = DSQ.xcframework; sourceTree = "<group>"; }; C2F4176D2BFE2FBD00CFF0B3 /* DSQ.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = DSQ.xcframework; sourceTree = "<group>"; };
C2F4176E2BFE2FBD00CFF0B3 /* capture.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = capture.png; sourceTree = "<group>"; }; C2F4176E2BFE2FBD00CFF0B3 /* capture.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = capture.png; sourceTree = "<group>"; };
@ -101,14 +101,14 @@
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
82F9D32F2BFE3A75009EDFAF /* Historic */ = { 82F9D32F2BFE3A75009EDFAF /* History */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
82F9D3302BFE3A9F009EDFAF /* DetailGameHistory.swift */, 82F9D3302BFE3A9F009EDFAF /* HistoryGameDetail.swift */,
82F9D3322BFE3B12009EDFAF /* EnteteHistory.swift */, 82F9D3322BFE3B12009EDFAF /* HistoryHeader.swift */,
82F9D3352BFE3B3C009EDFAF /* History.swift */, 82F9D3352BFE3B3C009EDFAF /* HistoryView.swift */,
); );
path = Historic; path = History;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
C205A2AA2BF373360097BD93 = { C205A2AA2BF373360097BD93 = {
@ -147,13 +147,10 @@
C205A2BC2BF373380097BD93 /* Views */ = { C205A2BC2BF373380097BD93 /* Views */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
82F9D32F2BFE3A75009EDFAF /* Historic */, C25220EB2C00A9230026B71F /* GeneralParametersMenu */,
C25220EA2C00A9010026B71F /* MainMenu */,
82F9D32F2BFE3A75009EDFAF /* History */,
C205A2BD2BF373380097BD93 /* Preview Assets.xcassets */, C205A2BD2BF373380097BD93 /* Preview Assets.xcassets */,
C24659E42BF5FE09004E80D5 /* MainMenu.swift */,
C24659E82BF60FAA004E80D5 /* MainMenuButton.swift */,
C20310D52BFCB5FB0031657D /* DoushiQiPicker.swift */,
C20310D72BFCC2410031657D /* ParametersMenuView.swift */,
C20310D92BFCC8600031657D /* ToggleView.swift */,
); );
path = Views; path = Views;
sourceTree = "<group>"; sourceTree = "<group>";
@ -175,6 +172,25 @@
path = ArkitDoushiQiUITests; path = ArkitDoushiQiUITests;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
C25220EA2C00A9010026B71F /* MainMenu */ = {
isa = PBXGroup;
children = (
C24659E82BF60FAA004E80D5 /* MainMenuButtonComponent.swift */,
C24659E42BF5FE09004E80D5 /* MainMenu.swift */,
);
path = MainMenu;
sourceTree = "<group>";
};
C25220EB2C00A9230026B71F /* GeneralParametersMenu */ = {
isa = PBXGroup;
children = (
C20310D92BFCC8600031657D /* ToggleComponent.swift */,
C20310D52BFCB5FB0031657D /* PickerComponent.swift */,
C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */,
);
path = GeneralParametersMenu;
sourceTree = "<group>";
};
C2F4176A2BFE2F8C00CFF0B3 /* Model */ = { C2F4176A2BFE2F8C00CFF0B3 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -328,15 +344,15 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
C205A2B92BF373360097BD93 /* ContentView.swift in Sources */, C205A2B92BF373360097BD93 /* ContentView.swift in Sources */,
82F9D3312BFE3A9F009EDFAF /* DetailGameHistory.swift in Sources */, 82F9D3312BFE3A9F009EDFAF /* HistoryGameDetail.swift in Sources */,
C24659E92BF60FAA004E80D5 /* MainMenuButton.swift in Sources */, C24659E92BF60FAA004E80D5 /* MainMenuButtonComponent.swift in Sources */,
C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */, C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */,
82F9D3362BFE3B3C009EDFAF /* History.swift in Sources */, 82F9D3362BFE3B3C009EDFAF /* HistoryView.swift in Sources */,
C20310D82BFCC2410031657D /* ParametersMenuView.swift in Sources */, C20310D82BFCC2410031657D /* GeneralParametersMenuView.swift in Sources */,
C205A2B72BF373360097BD93 /* ArkitDoushiQiApp.swift in Sources */, C205A2B72BF373360097BD93 /* ArkitDoushiQiApp.swift in Sources */,
C20310D62BFCB5FB0031657D /* DoushiQiPicker.swift in Sources */, C20310D62BFCB5FB0031657D /* PickerComponent.swift in Sources */,
82F9D3332BFE3B12009EDFAF /* EnteteHistory.swift in Sources */, 82F9D3332BFE3B12009EDFAF /* HistoryHeader.swift in Sources */,
C20310DA2BFCC8600031657D /* ToggleView.swift in Sources */, C20310DA2BFCC8600031657D /* ToggleComponent.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

@ -27,7 +27,7 @@ enum Rules: String, CaseIterable, Identifiable, Hashable {
var id: String { self.rawValue } var id: String { self.rawValue }
} }
struct ParametersMenuView: View { struct GeneralParametersMenuView: View {
@State private var selectedAIOption: AIT = .RandomAction @State private var selectedAIOption: AIT = .RandomAction
@State private var selectedLanguageOption: Language = .French @State private var selectedLanguageOption: Language = .French
@State private var selectedRulesOption: Rules = .Regular @State private var selectedRulesOption: Rules = .Regular
@ -37,14 +37,14 @@ struct ParametersMenuView: View {
Text("Paramètres").bold().font(.title) Text("Paramètres").bold().font(.title)
}.frame(maxWidth: .infinity) }.frame(maxWidth: .infinity)
Spacer().frame(maxHeight: 30) Spacer().frame(maxHeight: 30)
ToggleView() ToggleComponent()
DoushiQiPicker(title: "Sélectionne une IA :", PickerComponent(title: "Sélectionne une IA :",
selectedOption: $selectedAIOption, selectedOption: $selectedAIOption,
options: AIT.allCases) options: AIT.allCases)
DoushiQiPicker(title: "Sélectionne un langage :", PickerComponent(title: "Sélectionne un langage :",
selectedOption: $selectedLanguageOption, selectedOption: $selectedLanguageOption,
options: Language.allCases) options: Language.allCases)
DoushiQiPicker(title: "Sélectionne les règles :", PickerComponent(title: "Sélectionne les règles :",
selectedOption: $selectedRulesOption, selectedOption: $selectedRulesOption,
options: Rules.allCases) options: Rules.allCases)
@ -52,8 +52,8 @@ struct ParametersMenuView: View {
} }
} }
struct ParametersMenuView_Previews: PreviewProvider { struct GeneralParametersMenuView_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
ParametersMenuView() GeneralParametersMenuView()
} }
} }

@ -7,7 +7,7 @@
import SwiftUI import SwiftUI
struct DoushiQiPicker<EnumType: RawRepresentable & Identifiable & Hashable>: View where EnumType.RawValue == String { struct PickerComponent<EnumType: RawRepresentable & Identifiable & Hashable>: View where EnumType.RawValue == String {
let title: String let title: String
@Binding var selectedOption: EnumType @Binding var selectedOption: EnumType
let options: [EnumType] let options: [EnumType]
@ -48,7 +48,7 @@ struct DoushiQiPicker<EnumType: RawRepresentable & Identifiable & Hashable>: Vie
} }
} }
struct DoushiQiPicker_Previews: PreviewProvider { struct PickerComponent_Previews: PreviewProvider {
enum AI: String, CaseIterable, Identifiable, Hashable { enum AI: String, CaseIterable, Identifiable, Hashable {
case RandomAction = "IA Random" case RandomAction = "IA Random"
case EasyTrainedAI = "IA Facile" case EasyTrainedAI = "IA Facile"
@ -58,7 +58,7 @@ struct DoushiQiPicker_Previews: PreviewProvider {
} }
@State static var selectedItem = AI.RandomAction @State static var selectedItem = AI.RandomAction
static var previews: some View { static var previews: some View {
DoushiQiPicker( PickerComponent(
title: "Selectionne une IA :", title: "Selectionne une IA :",
selectedOption: $selectedItem, selectedOption: $selectedItem,
options: AI.allCases options: AI.allCases

@ -7,7 +7,7 @@
import SwiftUI import SwiftUI
struct ToggleView: View { struct ToggleComponent: View {
@AppStorage("isDarkMode") private var isDarkMode = false @AppStorage("isDarkMode") private var isDarkMode = false
var body: some View { var body: some View {
Divider().background(Color.gray).padding(.vertical, 1) Divider().background(Color.gray).padding(.vertical, 1)
@ -18,10 +18,10 @@ struct ToggleView: View {
} }
} }
struct ToggleView_Previews: PreviewProvider { struct ToggleComponent_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
VStack{ VStack{
ToggleView() ToggleComponent()
} }
} }
} }

@ -8,7 +8,7 @@
import SwiftUI import SwiftUI
import DouShouQiModel import DouShouQiModel
struct DetailGameHistory: View { struct HistoryGameDetail: View {
let game:Game let game:Game
@ -26,8 +26,8 @@ struct DetailGameHistory: View {
} }
} }
struct DetailGameHistory_Previews: PreviewProvider { struct HistoryGameDetail_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
DetailGameHistory(game: try! Game(withRules: VerySimpleRules(), andPlayer1: Player(withName: "Player 1 ", andId: .player1)!, andPlayer2: Player(withName: "Player 2 ", andId: .player2)!)) HistoryGameDetail(game: try! Game(withRules: VerySimpleRules(), andPlayer1: Player(withName: "Joueur 1 ", andId: .player1)!, andPlayer2: Player(withName: "Joueur 2 ", andId: .player2)!))
} }
} }

@ -7,18 +7,18 @@
import SwiftUI import SwiftUI
struct EnteteHistory: View { struct HistoryHeader: View {
var body: some View { var body: some View {
HStack(){ HStack(){
Spacer() Spacer()
Text("Historic !") Text("Historique !")
Spacer() Spacer()
} }
} }
} }
struct EnteteHistory_Previews: PreviewProvider { struct HistoryHeader_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
EnteteHistory() HistoryHeader()
} }
} }

@ -8,24 +8,24 @@
import SwiftUI import SwiftUI
import DouShouQiModel import DouShouQiModel
struct History: View { 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 listGame:[Game] = try! [Game(withRules: VerySimpleRules(), andPlayer1: Player(withName: "Player 1 ", andId: .player1)!, andPlayer2: Player(withName: "Player 2 ", andId: .player2)!)]
var body: some View { var body: some View {
VStack(){ VStack(){
EnteteHistory() HistoryHeader()
NavigationStack { NavigationStack {
List(listGame, id: \.board){ game in List(listGame, id: \.board){ game in
DetailGameHistory(game: game) HistoryGameDetail(game: game)
} }
} }
} }
} }
} }
struct History_Previews: PreviewProvider { struct HistoryView_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
History() HistoryView()
} }
} }

@ -25,14 +25,14 @@ struct MainMenu: View {
} }
Spacer().frame(height: 40) Spacer().frame(height: 40)
VStack(alignment: .leading) { VStack(alignment: .leading) {
MainMenuButton(title: playButtonText) MainMenuButtonComponent(title: playButtonText)
{ Text("jeu page") } { Text("jeu page") }
Spacer().frame(height: 30) Spacer().frame(height: 30)
MainMenuButton(title: registeredGamesButtonText) MainMenuButtonComponent(title: registeredGamesButtonText)
{ Text("parties enregistrées page") } { Text("parties enregistrées page") }
Spacer().frame(height: 30) Spacer().frame(height: 30)
MainMenuButton(title: ParametersButtontText) MainMenuButtonComponent(title: ParametersButtontText)
{ ParametersMenuView() } { GeneralParametersMenuView() }
} }
Spacer() Spacer()
} }

@ -7,7 +7,7 @@
import SwiftUI import SwiftUI
struct MainMenuButton<Content : View>: View { struct MainMenuButtonComponent<Content : View>: View {
let content: Content let content: Content
let title: String let title: String
@ -33,11 +33,11 @@ struct MainMenuButton<Content : View>: View {
} }
} }
struct MainMenuButton_Previews: PreviewProvider { struct MainMenuButtonComponent_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
NavigationView { NavigationView {
VStack { VStack {
MainMenuButton(title: "Parties enregistrées") { MainMenuButtonComponent(title: "Parties enregistrées") {
Text("Je suis un test") Text("Je suis un test")
} }
} }
Loading…
Cancel
Save