diff --git a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj index c4cad3e..c3069b9 100644 --- a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj +++ b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 645B4C202BFCCA0500FD658A /* PlayerScoreResumeFrame.swift in Sources */ = {isa = PBXBuildFile; fileRef = 645B4C1F2BFCCA0500FD658A /* PlayerScoreResumeFrame.swift */; }; 645B4C252BFCD3C600FD658A /* ScoreBoardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 645B4C242BFCD3C600FD658A /* ScoreBoardView.swift */; }; 646F04BE2C0F54C0003C8600 /* SettingsVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 646F04BD2C0F54C0003C8600 /* SettingsVM.swift */; }; + 646F04C12C0F5C11003C8600 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = 646F04C02C0F5C11003C8600 /* Language.swift */; }; 646FA83E2C072340001466BA /* GameVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 646FA83D2C072340001466BA /* GameVM.swift */; }; 646FA8432C0730D6001466BA /* HistoricVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 646FA8422C0730D6001466BA /* HistoricVM.swift */; }; 647D565C2BFD0212008D02EA /* PlayerResumeFrame.swift in Sources */ = {isa = PBXBuildFile; fileRef = 647D565B2BFD0212008D02EA /* PlayerResumeFrame.swift */; }; @@ -91,6 +92,7 @@ 645B4C1F2BFCCA0500FD658A /* PlayerScoreResumeFrame.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerScoreResumeFrame.swift; sourceTree = ""; }; 645B4C242BFCD3C600FD658A /* ScoreBoardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScoreBoardView.swift; sourceTree = ""; }; 646F04BD2C0F54C0003C8600 /* SettingsVM.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsVM.swift; sourceTree = ""; }; + 646F04C02C0F5C11003C8600 /* Language.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Language.swift; sourceTree = ""; }; 646FA83D2C072340001466BA /* GameVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameVM.swift; sourceTree = ""; }; 646FA8422C0730D6001466BA /* HistoricVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoricVM.swift; sourceTree = ""; }; 647D565B2BFD0212008D02EA /* PlayerResumeFrame.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerResumeFrame.swift; sourceTree = ""; }; @@ -186,6 +188,7 @@ 6458345A2BF5F92300E18321 /* DouShouQi_App */ = { isa = PBXGroup; children = ( + 646F04BF2C0F5BD1003C8600 /* AppModelAndExtension */, 646FA83C2C072284001466BA /* ViewModel */, ECB6364F2C04635D007CD5E2 /* SoundPlayerClass */, 649B59A52BF64B1B002BAE38 /* Assets */, @@ -256,6 +259,14 @@ path = Settings; sourceTree = ""; }; + 646F04BF2C0F5BD1003C8600 /* AppModelAndExtension */ = { + isa = PBXGroup; + children = ( + 646F04C02C0F5C11003C8600 /* Language.swift */, + ); + path = AppModelAndExtension; + sourceTree = ""; + }; 646FA83C2C072284001466BA /* ViewModel */ = { isa = PBXGroup; children = ( @@ -561,6 +572,7 @@ EC05BFC42C04C3C4000F7B19 /* SettingsView.swift in Sources */, EC62C50F2C05D06A0048CD0B /* AddPlayerView.swift in Sources */, 64FC4D6B2C09C7C900D08B8B /* SelectPlayerButtonView.swift in Sources */, + 646F04C12C0F5C11003C8600 /* Language.swift in Sources */, EC05BFC82C04D832000F7B19 /* CustomSwitchButton.swift in Sources */, 64D992722C06281B002ACBC6 /* SystemIcons.swift in Sources */, 645B4C252BFCD3C600FD658A /* ScoreBoardView.swift in Sources */, diff --git a/DouShouQi_App/DouShouQi_App/AppModelAndExtension/Language.swift b/DouShouQi_App/DouShouQi_App/AppModelAndExtension/Language.swift new file mode 100644 index 0000000..af70eea --- /dev/null +++ b/DouShouQi_App/DouShouQi_App/AppModelAndExtension/Language.swift @@ -0,0 +1,32 @@ +// +// Language.swift +// DouShouQi_App +// +// Created by Rémi REGNAULT on 04/06/2024. +// + +import Foundation + +public enum Language: String, Identifiable { + + case french, english, spanish + + public var id: String { + return self.rawValue + } + + public var litteral: String { + switch self { + case .french: + return "Français" + case .english: + return "English" + case .spanish: + return "Español" + } + } + + static var list: [Language] { + return [.french, .english, .spanish] + } +} diff --git a/DouShouQi_App/DouShouQi_App/ViewModel/Settings/SettingsVM.swift b/DouShouQi_App/DouShouQi_App/ViewModel/Settings/SettingsVM.swift index c92ec49..d841c32 100644 --- a/DouShouQi_App/DouShouQi_App/ViewModel/Settings/SettingsVM.swift +++ b/DouShouQi_App/DouShouQi_App/ViewModel/Settings/SettingsVM.swift @@ -8,30 +8,6 @@ import Foundation import SwiftUI -public enum Language: String, Identifiable { - - case french, english, spanish - - public var id: String { - return self.rawValue - } - - public var litteral: String { - switch self { - case .french: - return "Français" - case .english: - return "English" - case .spanish: - return "Español" - } - } - - static var list: [Language] { - return [.french, .english, .spanish] - } -} - class SettingsVM: ObservableObject { // Properties @Published var darkTheme: Bool = false