//
//  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 ParametersMenuView: 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)
            ToggleView()
            DoushiQiPicker(title: "Sélectionne une IA :",
                           selectedOption: $selectedAIOption,
                           options: AIT.allCases)
            DoushiQiPicker(title: "Sélectionne un langage :",
                           selectedOption: $selectedLanguageOption,
                           options: Language.allCases)
            DoushiQiPicker(title: "Sélectionne les règles :",
                           selectedOption: $selectedRulesOption,
                           options: Rules.allCases)
            
        }.frame(maxHeight: .infinity, alignment: .top)
    }
}

struct ParametersMenuView_Previews: PreviewProvider {
    static var previews: some View {
        ParametersMenuView()
    }
}
