You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.9 KiB
60 lines
1.9 KiB
//
|
|
// ParametersMenuView.swift
|
|
// ArkitDoushiQi
|
|
//
|
|
// Created by Johan LACHENAL on 21/05/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
enum AIT: String, CaseIterable, Identifiable, Hashable {
|
|
case RandomAction = "IA Random"
|
|
case EasyTrainedAI = "IA Facile"
|
|
case MediumTrainedAI = "IA Intermédiaire"
|
|
|
|
var id: String { self.rawValue }
|
|
}
|
|
|
|
enum Language: String, CaseIterable, Identifiable, Hashable {
|
|
case French = "Français"
|
|
case English = "English"
|
|
var id: String { self.rawValue }
|
|
}
|
|
|
|
enum Rules: String, CaseIterable, Identifiable, Hashable {
|
|
case Easy = "Simplifié"
|
|
case Regular = "Normal"
|
|
var id: String { self.rawValue }
|
|
}
|
|
|
|
struct GeneralParametersMenuView: View {
|
|
@State private var selectedAIOption: AIT = .RandomAction
|
|
@State private var selectedLanguageOption: Language = .French
|
|
@State private var selectedRulesOption: Rules = .Regular
|
|
var body: some View {
|
|
VStack(alignment: .leading) {
|
|
HStack(alignment: .center) {
|
|
Text("Paramètres").bold().font(.title)
|
|
}.frame(maxWidth: .infinity)
|
|
Spacer().frame(maxHeight: 30)
|
|
ToggleComponent()
|
|
PickerComponent(title: "Sélectionne une IA :",
|
|
selectedOption: $selectedAIOption,
|
|
options: AIT.allCases)
|
|
PickerComponent(title: "Sélectionne un langage :",
|
|
selectedOption: $selectedLanguageOption,
|
|
options: Language.allCases)
|
|
PickerComponent(title: "Sélectionne les règles :",
|
|
selectedOption: $selectedRulesOption,
|
|
options: Rules.allCases)
|
|
|
|
}.frame(maxHeight: .infinity, alignment: .top)
|
|
}
|
|
}
|
|
|
|
struct GeneralParametersMenuView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
GeneralParametersMenuView()
|
|
}
|
|
}
|