diff --git a/.DS_Store b/.DS_Store index 86a291f..ca7d508 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/3DModel/CatPiece.usdz b/3DModel/CatPiece.usdz new file mode 100644 index 0000000..021f023 Binary files /dev/null and b/3DModel/CatPiece.usdz differ diff --git a/3DModel/LionPiece.usdz b/3DModel/LionPiece.usdz new file mode 100644 index 0000000..64eea9f Binary files /dev/null and b/3DModel/LionPiece.usdz differ diff --git a/ArkitDoushiQi/ArkitDoushiQi.xcodeproj/project.pbxproj b/ArkitDoushiQi/ArkitDoushiQi.xcodeproj/project.pbxproj index a75f232..c3747c0 100644 --- a/ArkitDoushiQi/ArkitDoushiQi.xcodeproj/project.pbxproj +++ b/ArkitDoushiQi/ArkitDoushiQi.xcodeproj/project.pbxproj @@ -7,12 +7,16 @@ objects = { /* Begin PBXBuildFile section */ + 16038A272C197B800074346E /* FlagManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16038A262C197B800074346E /* FlagManager.swift */; }; + 161A8E932C2055EA00D1ADFE /* Placeholder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 161A8E922C2055EA00D1ADFE /* Placeholder.swift */; }; + 165725EA2C1984CC0052D7EF /* FontManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165725E92C1984CC0052D7EF /* FontManager.swift */; }; + 16FA05922C1C154A0042D688 /* LanguagePickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16FA05912C1C154A0042D688 /* LanguagePickerView.swift */; }; + 16FA05942C1C1A380042D688 /* Rules.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16FA05932C1C1A380042D688 /* Rules.swift */; }; + 16FA05962C1C1A5F0042D688 /* GameType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16FA05952C1C1A5F0042D688 /* GameType.swift */; }; 82CE59E92C045D1100ADEE24 /* GameScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59E82C045D1100ADEE24 /* GameScene.swift */; }; 82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59EA2C045E3800ADEE24 /* GameView.swift */; }; 82CE59EF2C0460E500ADEE24 /* SpriteMoople.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59EE2C0460E500ADEE24 /* SpriteMoople.swift */; }; - C20310D82BFCC2410031657D /* GeneralParametersMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */; }; C205A2B72BF373360097BD93 /* ArkitDoushiQiApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2B62BF373360097BD93 /* ArkitDoushiQiApp.swift */; }; - C205A2B92BF373360097BD93 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2B82BF373360097BD93 /* ContentView.swift */; }; C205A2BB2BF373380097BD93 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C205A2BA2BF373380097BD93 /* Assets.xcassets */; }; C205A2BE2BF373380097BD93 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C205A2BD2BF373380097BD93 /* Preview Assets.xcassets */; }; C205A2C82BF373380097BD93 /* WtaTennisTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2C72BF373380097BD93 /* WtaTennisTests.swift */; }; @@ -21,13 +25,14 @@ C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24659E42BF5FE09004E80D5 /* MainMenu.swift */; }; C25220EE2C00AC7E0026B71F /* GameParametersMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */; }; C2A535D92C0F56A800503472 /* DSQ.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2A535D82C0F56A700503472 /* DSQ.xcframework */; }; - C2DCC2B42C197BEC008AB78F /* ActionRemove.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2DCC2B32C197BEC008AB78F /* ActionRemove.swift */; }; - C2DCC2B62C1980A9008AB78F /* Spark.sks in Resources */ = {isa = PBXBuildFile; fileRef = C2DCC2B52C1980A9008AB78F /* Spark.sks */; }; - C2DCC2BA2C19849A008AB78F /* Magic.sks in Resources */ = {isa = PBXBuildFile; fileRef = C2DCC2B82C19849A008AB78F /* Magic.sks */; }; - C2DCC2BB2C19849A008AB78F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C2DCC2B92C19849A008AB78F /* Assets.xcassets */; }; - C2DCC2BD2C19869B008AB78F /* Fireworks.sks in Resources */ = {isa = PBXBuildFile; fileRef = C2DCC2BC2C19869B008AB78F /* Fireworks.sks */; }; - C2DCC2BF2C198702008AB78F /* actionEndGame.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2DCC2BE2C198702008AB78F /* actionEndGame.swift */; }; - C2E32ED52C1C24A800DD37B6 /* FireworkLaunch.sks in Resources */ = {isa = PBXBuildFile; fileRef = C2E32ED42C1C24A800DD37B6 /* FireworkLaunch.sks */; }; + C2DF075B2C206EEF00BEE0E1 /* Stub.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2DF075A2C206EEF00BEE0E1 /* Stub.swift */; }; + C2DF07622C20719800BEE0E1 /* Magic.sks in Resources */ = {isa = PBXBuildFile; fileRef = C2DF075D2C20719800BEE0E1 /* Magic.sks */; }; + C2DF07632C20719800BEE0E1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C2DF075E2C20719800BEE0E1 /* Assets.xcassets */; }; + C2DF07642C20719800BEE0E1 /* Spark.sks in Resources */ = {isa = PBXBuildFile; fileRef = C2DF075F2C20719800BEE0E1 /* Spark.sks */; }; + C2DF07652C20719800BEE0E1 /* FireworkLaunch.sks in Resources */ = {isa = PBXBuildFile; fileRef = C2DF07602C20719800BEE0E1 /* FireworkLaunch.sks */; }; + C2DF07662C20719800BEE0E1 /* Fireworks.sks in Resources */ = {isa = PBXBuildFile; fileRef = C2DF07612C20719800BEE0E1 /* Fireworks.sks */; }; + C2DF076A2C2071B300BEE0E1 /* actionEndGame.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2DF07682C2071B300BEE0E1 /* actionEndGame.swift */; }; + C2DF076B2C2071B300BEE0E1 /* ActionRemove.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2DF07692C2071B300BEE0E1 /* ActionRemove.swift */; }; C2F015092C09D366000F7221 /* LanguageSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F015082C09D366000F7221 /* LanguageSettings.swift */; }; C2F0150C2C09D3A4000F7221 /* KeyboardReadable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F0150B2C09D3A4000F7221 /* KeyboardReadable.swift */; }; C2F015102C09D3C3000F7221 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F0150E2C09D3C3000F7221 /* Language.swift */; }; @@ -41,10 +46,7 @@ C2F015242C09D3E7000F7221 /* ProfileComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F0151B2C09D3E7000F7221 /* ProfileComponent.swift */; }; C2F015252C09D3E7000F7221 /* ItemCollectionParty.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F0151C2C09D3E7000F7221 /* ItemCollectionParty.swift */; }; C2F015262C09D3E7000F7221 /* ProfileEdit.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F0151D2C09D3E7000F7221 /* ProfileEdit.swift */; }; - C2F0152A2C09D420000F7221 /* Stub.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F015282C09D420000F7221 /* Stub.swift */; }; C2F0152B2C09D420000F7221 /* PartyEnregistery.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F015292C09D420000F7221 /* PartyEnregistery.swift */; }; - C2F015392C09D5A5000F7221 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C2F015372C09D5A5000F7221 /* Localizable.strings */; }; - C2F0153D2C09D5C0000F7221 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C2F0153B2C09D5C0000F7221 /* Localizable.strings */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -65,13 +67,21 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 16038A262C197B800074346E /* FlagManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlagManager.swift; sourceTree = ""; }; + 16038A2A2C197DEC0074346E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + 161A8E922C2055EA00D1ADFE /* Placeholder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Placeholder.swift; sourceTree = ""; }; + 165725E92C1984CC0052D7EF /* FontManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontManager.swift; sourceTree = ""; }; + 165725F02C1985920052D7EF /* nuku1.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = nuku1.ttf; sourceTree = ""; }; + 16FA058B2C1C14F50042D688 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Localizable.strings; sourceTree = ""; }; + 16FA058F2C1C14FD0042D688 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = Localizable.strings; sourceTree = ""; }; + 16FA05912C1C154A0042D688 /* LanguagePickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguagePickerView.swift; sourceTree = ""; }; + 16FA05932C1C1A380042D688 /* Rules.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Rules.swift; sourceTree = ""; }; + 16FA05952C1C1A5F0042D688 /* GameType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameType.swift; sourceTree = ""; }; 82CE59E82C045D1100ADEE24 /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = ""; }; 82CE59EA2C045E3800ADEE24 /* GameView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameView.swift; sourceTree = ""; }; 82CE59EE2C0460E500ADEE24 /* SpriteMoople.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpriteMoople.swift; sourceTree = ""; }; - C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralParametersMenuView.swift; sourceTree = ""; }; 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 = ""; }; - C205A2B82BF373360097BD93 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; C205A2BA2BF373380097BD93 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; C205A2BD2BF373380097BD93 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; C205A2C32BF373380097BD93 /* ArkitDoushiQiTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ArkitDoushiQiTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -79,16 +89,17 @@ C205A2CD2BF373380097BD93 /* ArkitDoushiQiUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ArkitDoushiQiUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; C205A2D12BF373380097BD93 /* WtaTennisUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WtaTennisUITests.swift; sourceTree = ""; }; C205A2D32BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WtaTennisUITestsLaunchTests.swift; sourceTree = ""; }; - C24659E42BF5FE09004E80D5 /* MainMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenu.swift; sourceTree = ""; }; + C24659E42BF5FE09004E80D5 /* MainMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenu.swift; sourceTree = ""; usesTabs = 0; }; C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameParametersMenuView.swift; sourceTree = ""; }; C2A535D82C0F56A700503472 /* DSQ.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = DSQ.xcframework; path = ../NEPASTOUCHER/DSQ.xcframework; sourceTree = ""; }; - C2DCC2B32C197BEC008AB78F /* ActionRemove.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionRemove.swift; sourceTree = ""; }; - C2DCC2B52C1980A9008AB78F /* Spark.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Spark.sks; sourceTree = ""; }; - C2DCC2B82C19849A008AB78F /* Magic.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Magic.sks; sourceTree = ""; }; - C2DCC2B92C19849A008AB78F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C2DCC2BC2C19869B008AB78F /* Fireworks.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Fireworks.sks; sourceTree = ""; }; - C2DCC2BE2C198702008AB78F /* actionEndGame.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = actionEndGame.swift; sourceTree = ""; }; - C2E32ED42C1C24A800DD37B6 /* FireworkLaunch.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = FireworkLaunch.sks; sourceTree = ""; }; + C2DF075A2C206EEF00BEE0E1 /* Stub.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Stub.swift; sourceTree = ""; }; + C2DF075D2C20719800BEE0E1 /* Magic.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Magic.sks; sourceTree = ""; }; + C2DF075E2C20719800BEE0E1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + C2DF075F2C20719800BEE0E1 /* Spark.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Spark.sks; sourceTree = ""; }; + C2DF07602C20719800BEE0E1 /* FireworkLaunch.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = FireworkLaunch.sks; sourceTree = ""; }; + C2DF07612C20719800BEE0E1 /* Fireworks.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Fireworks.sks; sourceTree = ""; }; + C2DF07682C2071B300BEE0E1 /* actionEndGame.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = actionEndGame.swift; sourceTree = ""; }; + C2DF07692C2071B300BEE0E1 /* ActionRemove.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionRemove.swift; sourceTree = ""; }; C2F015082C09D366000F7221 /* LanguageSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LanguageSettings.swift; sourceTree = ""; }; C2F0150B2C09D3A4000F7221 /* KeyboardReadable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyboardReadable.swift; sourceTree = ""; }; C2F0150E2C09D3C3000F7221 /* Language.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Language.swift; sourceTree = ""; }; @@ -102,10 +113,7 @@ C2F0151B2C09D3E7000F7221 /* ProfileComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfileComponent.swift; sourceTree = ""; }; C2F0151C2C09D3E7000F7221 /* ItemCollectionParty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemCollectionParty.swift; sourceTree = ""; }; C2F0151D2C09D3E7000F7221 /* ProfileEdit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfileEdit.swift; sourceTree = ""; }; - C2F015282C09D420000F7221 /* Stub.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Stub.swift; sourceTree = ""; }; C2F015292C09D420000F7221 /* PartyEnregistery.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PartyEnregistery.swift; sourceTree = ""; }; - C2F015382C09D5A5000F7221 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Localizable.strings; sourceTree = ""; }; - C2F0153C2C09D5C0000F7221 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = Localizable.strings; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -134,6 +142,48 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 161A8E912C2055EA00D1ADFE /* Extension */ = { + isa = PBXGroup; + children = ( + 161A8E922C2055EA00D1ADFE /* Placeholder.swift */, + ); + path = Extension; + sourceTree = ""; + }; + 165725EB2C1985920052D7EF /* Ressources */ = { + isa = PBXGroup; + children = ( + 16FA058D2C1C14FD0042D688 /* fr.lproj */, + 16FA05892C1C14F50042D688 /* en.lproj */, + 165725EF2C1985920052D7EF /* Font */, + ); + path = Ressources; + sourceTree = ""; + }; + 165725EF2C1985920052D7EF /* Font */ = { + isa = PBXGroup; + children = ( + 165725F02C1985920052D7EF /* nuku1.ttf */, + ); + path = Font; + sourceTree = ""; + }; + 16FA05892C1C14F50042D688 /* en.lproj */ = { + isa = PBXGroup; + children = ( + 16FA058A2C1C14F50042D688 /* Localizable.strings */, + ); + path = en.lproj; + sourceTree = ""; + }; + 16FA058D2C1C14FD0042D688 /* fr.lproj */ = { + isa = PBXGroup; + children = ( + 16FA058E2C1C14FD0042D688 /* Localizable.strings */, + ); + path = fr.lproj; + sourceTree = ""; + }; 8203E9052BF60117005F5C4A /* Frameworks */ = { isa = PBXGroup; children = ( @@ -145,8 +195,8 @@ 82CE59E52C045C7500ADEE24 /* Game */ = { isa = PBXGroup; children = ( - C2DCC2B72C1980BA008AB78F /* SKAnimations */, - C2DCC2B22C197446008AB78F /* SKActions */, + C2DF07672C2071B300BEE0E1 /* SKActions */, + C2DF075C2C20719800BEE0E1 /* SKAnimations */, 82CE59EC2C0460AA00ADEE24 /* SKNodes */, 82CE59E82C045D1100ADEE24 /* GameScene.swift */, 82CE59EA2C045E3800ADEE24 /* GameView.swift */, @@ -165,6 +215,7 @@ C205A2AA2BF373360097BD93 = { isa = PBXGroup; children = ( + 165725EB2C1985920052D7EF /* Ressources */, C205A2B52BF373360097BD93 /* ArkitDoushiQi */, C205A2C62BF373380097BD93 /* ArkitDoushiQiTests */, C205A2D02BF373380097BD93 /* ArkitDoushiQiUITests */, @@ -186,11 +237,12 @@ C205A2B52BF373360097BD93 /* ArkitDoushiQi */ = { isa = PBXGroup; children = ( - C2F015352C09D592000F7221 /* Resources */, + C2DF07592C206EEF00BEE0E1 /* Data */, + 16038A2A2C197DEC0074346E /* Info.plist */, C2F015072C09D366000F7221 /* Utils */, 82CE59E52C045C7500ADEE24 /* Game */, C205A2B62BF373360097BD93 /* ArkitDoushiQiApp.swift */, - C205A2B82BF373360097BD93 /* ContentView.swift */, + C24659E42BF5FE09004E80D5 /* MainMenu.swift */, C205A2BA2BF373380097BD93 /* Assets.xcassets */, C205A2BC2BF373380097BD93 /* Views */, ); @@ -200,13 +252,13 @@ C205A2BC2BF373380097BD93 /* Views */ = { isa = PBXGroup; children = ( - C2F015272C09D420000F7221 /* PartyEnregistery */, + 161A8E912C2055EA00D1ADFE /* Extension */, + C2F015292C09D420000F7221 /* PartyEnregistery.swift */, + C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */, C2F015122C09D3E7000F7221 /* Components */, C2F0150D2C09D3C3000F7221 /* Enum */, C2F0150A2C09D3A4000F7221 /* EventTriggers */, C25220EC2C00AC530026B71F /* GameParametersMenu */, - C25220EB2C00A9230026B71F /* GeneralParametersMenu */, - C25220EA2C00A9010026B71F /* MainMenu */, C205A2BD2BF373380097BD93 /* Preview Assets.xcassets */, ); path = Views; @@ -229,55 +281,49 @@ path = ArkitDoushiQiUITests; sourceTree = ""; }; - C25220EA2C00A9010026B71F /* MainMenu */ = { + C25220EC2C00AC530026B71F /* GameParametersMenu */ = { isa = PBXGroup; children = ( - C24659E42BF5FE09004E80D5 /* MainMenu.swift */, ); - path = MainMenu; + path = GameParametersMenu; sourceTree = ""; }; - C25220EB2C00A9230026B71F /* GeneralParametersMenu */ = { + C2DF07592C206EEF00BEE0E1 /* Data */ = { isa = PBXGroup; children = ( - C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */, + C2DF075A2C206EEF00BEE0E1 /* Stub.swift */, ); - path = GeneralParametersMenu; + name = Data; + path = Views/Data; sourceTree = ""; }; - C25220EC2C00AC530026B71F /* GameParametersMenu */ = { + C2DF075C2C20719800BEE0E1 /* SKAnimations */ = { isa = PBXGroup; children = ( - C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */, + C2DF075D2C20719800BEE0E1 /* Magic.sks */, + C2DF075E2C20719800BEE0E1 /* Assets.xcassets */, + C2DF075F2C20719800BEE0E1 /* Spark.sks */, + C2DF07602C20719800BEE0E1 /* FireworkLaunch.sks */, + C2DF07612C20719800BEE0E1 /* Fireworks.sks */, ); - path = GameParametersMenu; + path = SKAnimations; sourceTree = ""; }; - C2DCC2B22C197446008AB78F /* SKActions */ = { + C2DF07672C2071B300BEE0E1 /* SKActions */ = { isa = PBXGroup; children = ( - C2DCC2B32C197BEC008AB78F /* ActionRemove.swift */, - C2DCC2BE2C198702008AB78F /* actionEndGame.swift */, + C2DF07682C2071B300BEE0E1 /* actionEndGame.swift */, + C2DF07692C2071B300BEE0E1 /* ActionRemove.swift */, ); path = SKActions; sourceTree = ""; }; - C2DCC2B72C1980BA008AB78F /* SKAnimations */ = { - isa = PBXGroup; - children = ( - C2DCC2B52C1980A9008AB78F /* Spark.sks */, - C2DCC2B82C19849A008AB78F /* Magic.sks */, - C2DCC2B92C19849A008AB78F /* Assets.xcassets */, - C2DCC2BC2C19869B008AB78F /* Fireworks.sks */, - C2E32ED42C1C24A800DD37B6 /* FireworkLaunch.sks */, - ); - path = SKAnimations; - sourceTree = ""; - }; C2F015072C09D366000F7221 /* Utils */ = { isa = PBXGroup; children = ( C2F015082C09D366000F7221 /* LanguageSettings.swift */, + 16038A262C197B800074346E /* FlagManager.swift */, + 165725E92C1984CC0052D7EF /* FontManager.swift */, ); path = Utils; sourceTree = ""; @@ -295,6 +341,8 @@ children = ( C2F0150E2C09D3C3000F7221 /* Language.swift */, C2F0150F2C09D3C3000F7221 /* AI.swift */, + 16FA05932C1C1A380042D688 /* Rules.swift */, + 16FA05952C1C1A5F0042D688 /* GameType.swift */, ); path = Enum; sourceTree = ""; @@ -315,8 +363,9 @@ C2F015152C09D3E7000F7221 /* ToggleComponent.swift */, C2F015162C09D3E7000F7221 /* ButtonComponent.swift */, C2F015172C09D3E7000F7221 /* EditImageComponent.swift */, - C2F015182C09D3E7000F7221 /* PhotoButtonComponent.swift */, C2F015192C09D3E7000F7221 /* EditTextComponent.swift */, + 16FA05912C1C154A0042D688 /* LanguagePickerView.swift */, + C2F015182C09D3E7000F7221 /* PhotoButtonComponent.swift */, ); path = Controls; sourceTree = ""; @@ -331,40 +380,6 @@ path = Visuals; sourceTree = ""; }; - C2F015272C09D420000F7221 /* PartyEnregistery */ = { - isa = PBXGroup; - children = ( - C2F015282C09D420000F7221 /* Stub.swift */, - C2F015292C09D420000F7221 /* PartyEnregistery.swift */, - ); - path = PartyEnregistery; - sourceTree = ""; - }; - C2F015352C09D592000F7221 /* Resources */ = { - isa = PBXGroup; - children = ( - C2F0153A2C09D5C0000F7221 /* fr.lproj */, - C2F015362C09D5A5000F7221 /* en.lproj */, - ); - path = Resources; - sourceTree = ""; - }; - C2F015362C09D5A5000F7221 /* en.lproj */ = { - isa = PBXGroup; - children = ( - C2F015372C09D5A5000F7221 /* Localizable.strings */, - ); - path = en.lproj; - sourceTree = SOURCE_ROOT; - }; - C2F0153A2C09D5C0000F7221 /* fr.lproj */ = { - isa = PBXGroup; - children = ( - C2F0153B2C09D5C0000F7221 /* Localizable.strings */, - ); - path = fr.lproj; - sourceTree = SOURCE_ROOT; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -470,14 +485,12 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C2DCC2BD2C19869B008AB78F /* Fireworks.sks in Resources */, - C2E32ED52C1C24A800DD37B6 /* FireworkLaunch.sks in Resources */, C205A2BE2BF373380097BD93 /* Preview Assets.xcassets in Resources */, - C2DCC2BA2C19849A008AB78F /* Magic.sks in Resources */, - C2DCC2B62C1980A9008AB78F /* Spark.sks in Resources */, - C2F0153D2C09D5C0000F7221 /* Localizable.strings in Resources */, - C2DCC2BB2C19849A008AB78F /* Assets.xcassets in Resources */, - C2F015392C09D5A5000F7221 /* Localizable.strings in Resources */, + C2DF07652C20719800BEE0E1 /* FireworkLaunch.sks in Resources */, + C2DF07642C20719800BEE0E1 /* Spark.sks in Resources */, + C2DF07662C20719800BEE0E1 /* Fireworks.sks in Resources */, + C2DF07622C20719800BEE0E1 /* Magic.sks in Resources */, + C2DF07632C20719800BEE0E1 /* Assets.xcassets in Resources */, C205A2BB2BF373380097BD93 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -504,30 +517,34 @@ buildActionMask = 2147483647; files = ( C2F015112C09D3C3000F7221 /* AI.swift in Sources */, - C2F0152A2C09D420000F7221 /* Stub.swift in Sources */, - C2DCC2BF2C198702008AB78F /* actionEndGame.swift in Sources */, + C2DF075B2C206EEF00BEE0E1 /* Stub.swift in Sources */, + C2DF076B2C2071B300BEE0E1 /* ActionRemove.swift in Sources */, C2F015252C09D3E7000F7221 /* ItemCollectionParty.swift in Sources */, - C205A2B92BF373360097BD93 /* ContentView.swift in Sources */, 82CE59EF2C0460E500ADEE24 /* SpriteMoople.swift in Sources */, C2F0150C2C09D3A4000F7221 /* KeyboardReadable.swift in Sources */, 82CE59E92C045D1100ADEE24 /* GameScene.swift in Sources */, C2F015242C09D3E7000F7221 /* ProfileComponent.swift in Sources */, + 16038A272C197B800074346E /* FlagManager.swift in Sources */, C2F0151E2C09D3E7000F7221 /* PickerComponent.swift in Sources */, - C2DCC2B42C197BEC008AB78F /* ActionRemove.swift in Sources */, C2F015212C09D3E7000F7221 /* EditImageComponent.swift in Sources */, C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */, - C20310D82BFCC2410031657D /* GeneralParametersMenuView.swift in Sources */, + 16FA05962C1C1A5F0042D688 /* GameType.swift in Sources */, C2F0151F2C09D3E7000F7221 /* ToggleComponent.swift in Sources */, C2F015202C09D3E7000F7221 /* ButtonComponent.swift in Sources */, C2F015262C09D3E7000F7221 /* ProfileEdit.swift in Sources */, + 16FA05942C1C1A380042D688 /* Rules.swift in Sources */, C205A2B72BF373360097BD93 /* ArkitDoushiQiApp.swift in Sources */, C2F015232C09D3E7000F7221 /* EditTextComponent.swift in Sources */, C2F015222C09D3E7000F7221 /* PhotoButtonComponent.swift in Sources */, C2F015092C09D366000F7221 /* LanguageSettings.swift in Sources */, + 16FA05922C1C154A0042D688 /* LanguagePickerView.swift in Sources */, + C2DF076A2C2071B300BEE0E1 /* actionEndGame.swift in Sources */, 82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */, C2F0152B2C09D420000F7221 /* PartyEnregistery.swift in Sources */, C2F015102C09D3C3000F7221 /* Language.swift in Sources */, + 165725EA2C1984CC0052D7EF /* FontManager.swift in Sources */, C25220EE2C00AC7E0026B71F /* GameParametersMenuView.swift in Sources */, + 161A8E932C2055EA00D1ADFE /* Placeholder.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -564,18 +581,18 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - C2F015372C09D5A5000F7221 /* Localizable.strings */ = { + 16FA058A2C1C14F50042D688 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( - C2F015382C09D5A5000F7221 /* en */, + 16FA058B2C1C14F50042D688 /* en */, ); name = Localizable.strings; sourceTree = ""; }; - C2F0153B2C09D5C0000F7221 /* Localizable.strings */ = { + 16FA058E2C1C14FD0042D688 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( - C2F0153C2C09D5C0000F7221 /* fr */, + 16FA058F2C1C14FD0042D688 /* fr */, ); name = Localizable.strings; sourceTree = ""; @@ -707,6 +724,7 @@ DEVELOPMENT_ASSET_PATHS = "\"ArkitDoushiQi/Views\""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ArkitDoushiQi/Info.plist; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; @@ -735,6 +753,7 @@ DEVELOPMENT_ASSET_PATHS = "\"ArkitDoushiQi/Views\""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ArkitDoushiQi/Info.plist; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; diff --git a/ArkitDoushiQi/ArkitDoushiQi/ArkitDoushiQiApp.swift b/ArkitDoushiQi/ArkitDoushiQi/ArkitDoushiQiApp.swift index 2ccbca9..69ad0b1 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/ArkitDoushiQiApp.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/ArkitDoushiQiApp.swift @@ -21,10 +21,8 @@ struct ArkitDoushiQiApp: App { @StateObject private var languageSettings = LanguageSettings(selectedLanguage: .English) var body: some Scene { WindowGroup { - MainMenu( - playButtonText: "Play", - registeredGamesButtonText: "Registered Games", - parametersButtonText: "Parameters" + MainMenu(playButtonText: "Play", registeredGamesButtonText: "Registered Games") + .environmentObject(LanguageSettings(selectedLanguage: .French) ) .environmentObject(languageSettings) .preferredColorScheme(isDarkMode ? .dark : .light) diff --git a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_dark.imageset/Contents.json b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_dark.imageset/Contents.json new file mode 100644 index 0000000..bb84cad --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_dark.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "background_dark.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_dark.imageset/background_dark.svg b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_dark.imageset/background_dark.svg new file mode 100644 index 0000000..7d2ba14 --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_dark.imageset/background_dark.svg @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_light.imageset/Contents.json b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_light.imageset/Contents.json new file mode 100644 index 0000000..a12002b --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_light.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "background_light.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_light.imageset/background_light.svg b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_light.imageset/background_light.svg new file mode 100644 index 0000000..812ebfe --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/background_light.imageset/background_light.svg @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ArkitDoushiQi/ArkitDoushiQi/AvatarView.swift b/ArkitDoushiQi/ArkitDoushiQi/AvatarView.swift deleted file mode 100644 index 6db41eb..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/AvatarView.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// AvatarView.swift -// WtaTennis -// -// Created by Johan LACHENAL on 14/05/2024. -// - -import SwiftUI - -struct AvatarView: View { - var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) - } -} - -struct AvatarView_Previews: PreviewProvider { - static var previews: some View { - AvatarView() - } -} diff --git a/ArkitDoushiQi/ArkitDoushiQi/ContentView.swift b/ArkitDoushiQi/ArkitDoushiQi/ContentView.swift deleted file mode 100644 index 309e5b4..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/ContentView.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ContentView.swift -// WtaTennis -// -// Created by Johan LACHENAL on 14/05/2024. -// - -import SwiftUI - -struct ContentView: View { - var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundColor(.accentColor) - Text("Hello, world!") - } - .padding() - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView() - } -} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Game/GameScene.swift b/ArkitDoushiQi/ArkitDoushiQi/Game/GameScene.swift index a062f50..d4f16e5 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Game/GameScene.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Game/GameScene.swift @@ -1,76 +1,83 @@ // -// MyScene.swift +// GameScene.swift // ArkitDoushiQi // -// Created by Enzo JOLYS on 27/05/2024. +// Created by Enzo JOLYS, Louis DUFOUR on 27/05/2024. // import Foundation import SpriteKit import DouShouQiModel - -class GameScene : SKScene { - - var isGameOver = false - let imageBoard:SKSpriteNode = SKSpriteNode(imageNamed: "board") - var game:Game = try! Game(withRules: ClassicRules(), andPlayer1: HumanPlayer(withName: "Bot1", andId: .player1)!, andPlayer2: RandomPlayer(withName: "Bot2", andId: .player2)!) - - var pieces: [Owner : [ Animal : SpriteMoople]] = [ .player1 : [ .cat : SpriteMoople(nameImage: "catMeeple", couleur: .red), - .dog : SpriteMoople(nameImage: "dogMeeple", couleur: .red), - .leopard : SpriteMoople(nameImage: "leopardMeeple", couleur: .red), - .lion : SpriteMoople(nameImage: "lionMeeple", couleur: .red), - .rat : SpriteMoople(nameImage: "ratMeeple", couleur: .red), - .wolf : SpriteMoople(nameImage: "wolfMeeple", couleur: .red), - .elephant : SpriteMoople(nameImage: "elephantMeeple", couleur: .red), - .tiger : SpriteMoople(nameImage: "tigerMeeple", couleur: .red)], - - .player2 : [ .cat : SpriteMoople(nameImage: "catMeeple", couleur: .blue), - .dog : SpriteMoople(nameImage: "dogMeeple", couleur: .blue), - .leopard : SpriteMoople(nameImage: "leopardMeeple", couleur: .blue), - .lion : SpriteMoople(nameImage: "lionMeeple", couleur: .blue), - .rat : SpriteMoople(nameImage: "ratMeeple", couleur: .blue), - .wolf : SpriteMoople(nameImage: "wolfMeeple", couleur: .blue), - .elephant : SpriteMoople(nameImage: "elephantMeeple", couleur: .blue), - .tiger : SpriteMoople(nameImage: "tigerMeeple", couleur: .blue)]] - - var deplacementPossible: [SKShapeNode] = [] - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - } - - override init(size: CGSize) { - super.init(size: size) - // -- -- // - scaleMode = .aspectFit - anchorPoint = CGPoint(x: 0.5, y: 0.5) - imageBoard.zPosition = 0 - self.addChild(imageBoard) - // -- -- // + class GameScene: SKScene { + var isGameOver = false + let imageBoard: SKSpriteNode = SKSpriteNode(imageNamed: "board") + var game: Game = try! Game(withRules: ClassicRules(), andPlayer1: HumanPlayer(withName: "Bot1", andId: .player1)!, andPlayer2: RandomPlayer(withName: "Bot2", andId: .player2)!) + + var player1Name: String + var player1Image: UIImage + var player2Name: String + var player2Image: UIImage + + var pieces: [Owner: [Animal: SpriteMoople]] = [ + .player1: [.cat: SpriteMoople(nameImage: "catMeeple", couleur: .red), + .dog: SpriteMoople(nameImage: "dogMeeple", couleur: .red), + .leopard: SpriteMoople(nameImage: "leopardMeeple", couleur: .red), + .lion: SpriteMoople(nameImage: "lionMeeple", couleur: .red), + .rat: SpriteMoople(nameImage: "ratMeeple", couleur: .red), + .wolf: SpriteMoople(nameImage: "wolfMeeple", couleur: .red), + .elephant: SpriteMoople(nameImage: "elephantMeeple", couleur: .red), + .tiger: SpriteMoople(nameImage: "tigerMeeple", couleur: .red)], + .player2: [.cat: SpriteMoople(nameImage: "catMeeple", couleur: .blue), + .dog: SpriteMoople(nameImage: "dogMeeple", couleur: .blue), + .leopard: SpriteMoople(nameImage: "leopardMeeple", couleur: .blue), + .lion: SpriteMoople(nameImage: "lionMeeple", couleur: .blue), + .rat: SpriteMoople(nameImage: "ratMeeple", couleur: .blue), + .wolf: SpriteMoople(nameImage: "wolfMeeple", couleur: .blue), + .elephant: SpriteMoople(nameImage: "elephantMeeple", couleur: .blue), + .tiger: SpriteMoople(nameImage: "tigerMeeple", couleur: .blue)] + ] - for c in pieces.flatMap({ _,values in return values }) - { - c.self.value.refGameScene = self - c.self.value.zPosition = 2 - self.addChild(c.self.value) + var deplacementPossible: [SKShapeNode] = [] + + init(size: CGSize, player1Name: String, player1Image: UIImage, player2Name: String, player2Image: UIImage) { + self.player1Name = player1Name + self.player1Image = player1Image + self.player2Name = player2Name + self.player2Image = player2Image + super.init(size: size) + + scaleMode = .aspectFit + anchorPoint = CGPoint(x: 0.5, y: 0.5) + imageBoard.zPosition = 0 + self.addChild(imageBoard) + + for c in pieces.flatMap({ $0.value }) { + c.value.refGameScene = self + c.value.zPosition = 2 + self.addChild(c.value) + } + + displayBoard(board: game.board) } - displayBoard(board: game.board) + required init?(coder aDecoder: NSCoder) { + self.player1Name = "" + self.player1Image = UIImage() + self.player2Name = "" + self.player2Image = UIImage() + super.init(coder: aDecoder) + } - } - - - func displayBoard(board:Board){ - for ligne in 0.. + + + + UTImportedTypeDeclarations + + + UTTypeIconFiles + + UTTypeTagSpecification + + + + UIAppFonts + + nuku1.ttf + + + diff --git a/ArkitDoushiQi/ArkitDoushiQi/InfoDetailView.swift b/ArkitDoushiQi/ArkitDoushiQi/InfoDetailView.swift deleted file mode 100644 index 899aa57..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/InfoDetailView.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// InfoDetailView.swift -// WtaTennis -// -// Created by Johan LACHENAL on 14/05/2024. -// - -import SwiftUI - -struct InfoDetailView: View { - var body: some View { - ZStack { - Color.purple.edgesIgnoringSafeArea(.all) - VStack(alignment: .leading, spacing: 20) { - Text("Iga Swiatek") - .font(.largeTitle) - .fontWeight(.bold) - .foregroundColor(.white) - - HStack { - Image(systemName: "flag.fill") - .foregroundColor(.white) - Text("POLAND") - .foregroundColor(.white) - } - - InfoTextView(title: "Height", value: "5' 9\"") - InfoTextView(title: "Age", value: "22") - InfoTextView(title: "Plays", value: "Right-Handed") - InfoTextView(title: "Birthplace", value: "Warsaw, Poland") - } - .padding() - } - } -} - -struct InfoDetailView_Previews: PreviewProvider { - static var previews: some View { - InfoDetailView() - } -} - diff --git a/ArkitDoushiQi/ArkitDoushiQi/MainMenu.swift b/ArkitDoushiQi/ArkitDoushiQi/MainMenu.swift new file mode 100644 index 0000000..275a08f --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/MainMenu.swift @@ -0,0 +1,131 @@ +// +// MainMenu.swift +// ArkitDoushiQi +// +// Created by Johan LACHENAL, Louis DUFOUR on 16/05/2024. +// + +import SwiftUI + +struct MainMenu: View { + @EnvironmentObject var languageSettings: LanguageSettings + let playButtonText: LocalizedStringKey + let registeredGamesButtonText: LocalizedStringKey + @State private var action: Int? = 0 + @AppStorage("isDarkMode") private var isDarkMode = false + @State private var reloadView = false + @State private var showLanguagePicker = false + @ScaledMetric(relativeTo: .body) var scaledPadding: CGFloat = 10 + @Environment(\.colorScheme) var colorScheme + + var body: some View { + GeometryReader { geometry in + let isLandscape = geometry.size.width > geometry.size.height + + NavigationStack { + ZStack(alignment: isLandscape ? .leading : .center) { + Image(uiImage: UIImage(named: colorScheme == .dark ? "background_dark" : "background_light")!) + .resizable() + .scaledToFit() + .frame(width: isLandscape ? geometry.size.width / 2 : geometry.size.width) + .edgesIgnoringSafeArea(.all) + + VStack { + Spacer().frame(height: 50) + + Text("DOUSHIQI") + .font(.custom("Nuku Nuku", size: 48, relativeTo: .largeTitle)) + .padding() + .background(colorScheme == .dark ? Color.black.opacity(0.6) : Color.white.opacity(0.6)) + .cornerRadius(8) + .foregroundColor(colorScheme == .dark ? .white : .black) + + Text("GAME") + .font(.custom("Nuku Nuku", size: 48, relativeTo: .largeTitle)) + .padding() + .background(colorScheme == .dark ? Color.black.opacity(0.6) : Color.white.opacity(0.6)) + .cornerRadius(8) + .foregroundColor(colorScheme == .dark ? .white : .black) + + Spacer() + + NavigationLink(destination: GameParametersMenuView()) { + Text(playButtonText) + .font(.custom("Nuku Nuku", size: 32, relativeTo: .title)) + .bold() + .frame(maxWidth: .infinity) + .padding() + .background(colorScheme == .dark ? Color.black.opacity(0.6) : Color.white.opacity(0.6)) + .foregroundColor(colorScheme == .dark ? .white : .black) + .cornerRadius(8) + .overlay( + RoundedRectangle(cornerRadius: 8) + .stroke(colorScheme == .dark ? Color.white : Color.black, lineWidth: 1) + ) + .shadow(radius: 5) + .padding(scaledPadding) + } + .padding(.horizontal, 50) + + Spacer().frame(height: 40) + + NavigationLink(destination: PartyListView()) { + Text(registeredGamesButtonText) + .font(.custom("Nuku Nuku", size: 18, relativeTo: .body)) + .padding() + .background(colorScheme == .dark ? Color.black.opacity(0.6) : Color.white.opacity(0.6)) + .foregroundColor(colorScheme == .dark ? .white : .black) + .cornerRadius(8) + .shadow(radius: 5) + .padding(scaledPadding) + } + .padding(.horizontal, 50) + + Spacer().frame(height: 20) + + HStack { + Button(action: { + isDarkMode.toggle() + }) { + Image(systemName: isDarkMode ? "sun.max.fill" : "moon.fill") + .foregroundColor(colorScheme == .dark ? .white : .black) + .padding() + .scaleEffect(1.2) + } + + Button(action: { + showLanguagePicker.toggle() + }) { + Image(systemName: "globe") + .foregroundColor(colorScheme == .dark ? .white : .black) + .padding() + .scaleEffect(1.2) + } + .sheet(isPresented: $showLanguagePicker) { + LanguagePickerView(showLanguagePicker: $showLanguagePicker) + .environmentObject(languageSettings) + } + } + .padding(scaledPadding) + .background(colorScheme == .dark ? Color.black.opacity(0.6) : Color.white.opacity(0.6)) + .cornerRadius(8) + + Spacer() + } + .padding(EdgeInsets(top: 10, leading: isLandscape ? geometry.size.width / 2 + 32 : 32, bottom: 10, trailing: 32)) + } + .environmentObject(languageSettings) + .onReceive(NotificationCenter.default.publisher(for: NSNotification.Name("LanguageChanged"))) { _ in + self.reloadView.toggle() + } + } + } + } +} + +struct MainMenu_Previews: PreviewProvider { + static var previews: some View { + MainMenu(playButtonText: "Play", registeredGamesButtonText: "Registered Games") + .environmentObject(LanguageSettings(selectedLanguage: .French)) + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/PlayerDetailView.swift b/ArkitDoushiQi/ArkitDoushiQi/PlayerDetailView.swift deleted file mode 100644 index 8b13789..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/PlayerDetailView.swift +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ArkitDoushiQi/ArkitDoushiQi/PlayerListView.swift b/ArkitDoushiQi/ArkitDoushiQi/PlayerListView.swift deleted file mode 100644 index ef31643..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/PlayerListView.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// PlayerListView.swift -// WtaTennis -// -// Created by Johan LACHENAL on 14/05/2024. -// - -import SwiftUI - -struct PlayerListView: View { - @ObservedObject var viewModel: PlayerViewModel - - var body: some View { - NavigationStack { - List(viewModel.players, id: \.id) { player in - PlayerProfileView(player: player) - .padding(.vertical, 5) - } - .navigationTitle("Top Players") - } - } -} - - -struct PlayerListView_Previews: PreviewProvider { - static var previews: some View { - PlayerListView(viewModel: PlayerViewModel()) - } -} diff --git a/ArkitDoushiQi/ArkitDoushiQi/PlayerProfileView.swift b/ArkitDoushiQi/ArkitDoushiQi/PlayerProfileView.swift deleted file mode 100644 index 98cd410..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/PlayerProfileView.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// ItemCollectionPlayer.swift -// WtaTennis -// -// Created by Johan LACHENAL on 14/05/2024. -// - -import SwiftUI - -struct PlayerProfileView: View { - - var body: some View { - HStack(spacing: 15) { - Text("1") // \(player.rank) - .font(.largeTitle) - .fontWeight(.bold) - .foregroundColor(.purple) - - Image("Image") - .resizable() - .aspectRatio(contentMode: .fill) - .frame(width: 50, height: 50) - .clipShape(Circle()) - - Text("Iga Swiatek") - .font(.title2) - .fontWeight(.semibold) - - Spacer() - - Label(" France ", systemImage: "flag.fill") - .labelStyle(.titleAndIcon) - .foregroundColor(.red) - } - .padding(.horizontal) - } -} - -struct PlayerProfileView_Previews: PreviewProvider { - static var previews: some View { - PlayerProfileView() - } -} diff --git a/ArkitDoushiQi/ArkitDoushiQi/RankingView.swift b/ArkitDoushiQi/ArkitDoushiQi/RankingView.swift deleted file mode 100644 index 40cd95a..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/RankingView.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// RankingView.swift -// WtaTennis -// -// Created by Johan LACHENAL on 14/05/2024. -// - -import SwiftUI - -struct RankingView: View { - - var body : some View { - ZStack() - { - Rectangle() - .fill(Color.purple) // Rectangle violet - .frame(height: 200) // Ajustez la hauteur du rectangle comme nécessaire - - VStack(alignment: .leading, spacing: 20) { - Text("RANKING") // TODO : penser à créer un style pour les textes - .font(.title) - .foregroundColor(.white) - Text("1") - .font(.largeTitle) - .fontWeight(.bold) - .foregroundColor(.white) - Text("Singles") - .font(.title2) - .foregroundColor(.white) - } - .padding() // Ajoutez un padding pour éloigner le texte des bords du rectangle - } - } -} - -struct RankingView_Previews: PreviewProvider { - static var previews: some View { - RankingView() - } -} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Utils/FlagManager.swift b/ArkitDoushiQi/ArkitDoushiQi/Utils/FlagManager.swift new file mode 100644 index 0000000..5401a9b --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Utils/FlagManager.swift @@ -0,0 +1,17 @@ +// +// FlagManager.swift +// ArkitDoushiQi +// +// Created by Louis DUFOUR on 12/06/2024. +// + +import SwiftUI + +func flag(country: String) -> String { + let base = 127397 + var usv = String.UnicodeScalarView() + for i in country.utf16 { + usv.append(UnicodeScalar(base + Int(i))!) + } + return String(usv) +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Utils/FontManager.swift b/ArkitDoushiQi/ArkitDoushiQi/Utils/FontManager.swift new file mode 100644 index 0000000..27df529 --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Utils/FontManager.swift @@ -0,0 +1,24 @@ +// +// FontManager.swift +// ArkitDoushiQi +// +// Created by Louis DUFOUR on 12/06/2024. +// + +import Foundation +import UIKit + +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + func application(_ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + + for family in UIFont.familyNames.sorted() { + let names = UIFont.fontNames(forFamilyName: family) + print("Family: \(family) Font names: \(names)") + } + + return true + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/ButtonComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/ButtonComponent.swift index ed86c3f..1d8b452 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/ButtonComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/ButtonComponent.swift @@ -7,21 +7,20 @@ import SwiftUI -struct ButtonComponent: View { +struct ButtonComponent: View { let content: Content - let title: String + let title: LocalizedStringKey - init(title: String, @ViewBuilder content: () -> Content) { - self.title = title - self.content = content() - } + init(title: LocalizedStringKey, @ViewBuilder content: () -> Content) { + self.title = title + self.content = content() + } var body: some View { NavigationLink { - // ici mettre la vue sur les parties enregistrées à la place du texte n'hésite pas à tester sur la preview la navigation ça marche, faire pareil pour les autres content } label: { - Text(title) + Text(title) .frame(maxWidth: .infinity) .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) .controlSize(.large) @@ -35,12 +34,12 @@ struct ButtonComponent: View { struct ButtonComponent_Previews: PreviewProvider { static var previews: some View { - NavigationView { - VStack { - ButtonComponent(title: "Parties enregistrées") { - Text("Je suis un test") - } + NavigationView { + VStack { + ButtonComponent(title: LocalizedStringKey("Parties enregistrées")) { + Text("Je suis un test") } } } + } } diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditImageComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditImageComponent.swift index 113e6dd..e9253c4 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditImageComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditImageComponent.swift @@ -9,48 +9,33 @@ import SwiftUI import PhotosUI struct EditImageComponent: View { - @State private var avatarItem: PhotosPickerItem? - @State private var avatarImage: Image? let color: Color let profileWidth: CGFloat let profileHeight: CGFloat let defaultImage: Image - let imageTextChange: String + let imageTextChange: LocalizedStringKey + @Binding var playerImage: UIImage + @State private var selectedImageItem: PhotosPickerItem? = nil + var body: some View { HStack { + Image(uiImage: playerImage) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: profileWidth, height: profileHeight) + .clipShape(Circle()) + .overlay(Circle().stroke(color, lineWidth: 2)) - VStack { - HStack { - GeometryReader { geometry in - ZStack { - // Background color - color - - // Profile Image - ProfileComponent(color: color, profileWidth: profileWidth, profileHeight: profileHeight, image: avatarImage ?? defaultImage - ) - } - // Ensure the ZStack takes the size of the GeometryReader - .frame(width: geometry.size.width, height: geometry.size.height) - .clipShape(Circle()) - } - .aspectRatio(1, contentMode: .fit) - .frame(width: profileWidth, height: profileHeight) // Optional fixed size - - PhotosPicker(selection: $avatarItem, matching: .images) { - Text(imageTextChange) - } - .onChange(of: avatarItem) { newValue in - if let newItem = newValue { - Task { - if let data = try? await newItem.loadTransferable(type: Data.self), - let uiImage = UIImage(data: data) { - avatarImage = Image(uiImage: uiImage) - } else { - print("Failed to load image") - } - } - } + PhotosPicker(selection: $selectedImageItem, matching: .images) { + Text(imageTextChange) + .foregroundColor(.blue) + .padding(.leading) + } + .onChange(of: selectedImageItem) { newItem in + Task { + if let data = try? await newItem?.loadTransferable(type: Data.self), + let uiImage = UIImage(data: data) { + playerImage = uiImage } } } @@ -65,10 +50,8 @@ struct EditImageComponent_Previews: PreviewProvider { profileWidth: 100, profileHeight: 100, defaultImage: Image("profil"), - imageTextChange: "Changer d'avatar" + imageTextChange: "Changer l'avatar", + playerImage: .constant(UIImage(named: "profil")!) ) - .previewLayout(.sizeThatFits) - .padding() } } - diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditTextComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditTextComponent.swift index a16a7fb..e1a4669 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditTextComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditTextComponent.swift @@ -8,23 +8,29 @@ import SwiftUI struct EditTextComponent: View { - let explanation : String - @State private var name : String - init(explanation: String, value: String) { - self.explanation = explanation - self.name = value - } + let explanation: LocalizedStringKey + @Binding var name: String + var body: some View { - Form { - Section(header : Text(explanation)) { - TextField(name, text : $name) - } + VStack(alignment: .leading) { + Text(explanation) + .font(.caption) + .foregroundColor(.gray) + + TextField("", text: $name) + .padding(10) + .background(Color(.systemGray6)) + .cornerRadius(5) + .placeholder(when: name.isEmpty) { + Text(explanation).foregroundColor(.gray) + } } } } struct EditTextComponent_Previews: PreviewProvider { static var previews: some View { - EditTextComponent(explanation: "Nom du Joueur 1", value: "Joueur 1") + EditTextComponent(explanation: "Nom du Joueur 1", name: .constant("Joueur 1")) } } + diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/LanguagePickerView.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/LanguagePickerView.swift new file mode 100644 index 0000000..93a8e63 --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/LanguagePickerView.swift @@ -0,0 +1,64 @@ +// +// LanguagePickerView.swift +// ArkitDoushiQi +// +// Created by Louis DUFOUR on 14/06/2024. +// + +import SwiftUI + +struct LanguagePickerView: View { + @Binding var showLanguagePicker: Bool + @EnvironmentObject var languageSettings: LanguageSettings + @Environment(\.colorScheme) var colorScheme + + var body: some View { + VStack(spacing: 30) { + Text(LocalizedStringKey("Choose Language")) + .font(.custom("Nuku Nuku", size: 38, relativeTo: .headline)) + .padding() + .foregroundColor(colorScheme == .dark ? .white : .black) + + HStack(spacing: 50) { + Button(action: { + languageSettings.selectedLanguage = .French + showLanguagePicker = false + }) { + VStack { + Text(flag(country: "FR")) + .font(.system(size: 50)) + Text(LocalizedStringKey("French")) + .font(.custom("Nuku Nuku", size: 28, relativeTo: .title2)) + .foregroundColor(colorScheme == .dark ? .white : .black) + } + } + + Button(action: { + languageSettings.selectedLanguage = .English + showLanguagePicker = false + }) { + VStack { + Text(flag(country: "GB")) + .font(.system(size: 50)) + Text(LocalizedStringKey("English")) + .font(.custom("Nuku Nuku", size: 28, relativeTo: .title2)) + .foregroundColor(colorScheme == .dark ? .white : .black) + } + } + } + + Button(action: { + showLanguagePicker = false + }) { + Text(LocalizedStringKey("Cancel")) + .font(.custom("Nuku Nuku", size: 28, relativeTo: .title2)) + .padding() + .background(Color.red.opacity(0.7)) + .foregroundColor(.white) + .cornerRadius(10) + } + .padding(.top, 20) + } + .padding() + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PickerComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PickerComponent.swift index 94d431f..9f8e774 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PickerComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PickerComponent.swift @@ -24,7 +24,7 @@ struct PickerComponent: Vi Menu { Picker(title, selection: $selectedOption) { ForEach(options) { option in - Text(option.rawValue.description) + Text(LocalizedStringKey(option.rawValue.description)) .tag(option) .padding() } @@ -37,7 +37,7 @@ struct PickerComponent: Vi .padding() .foregroundColor(.primary) Spacer() - Text(selectedOption.rawValue.description) + Text(LocalizedStringKey(selectedOption.rawValue.description)) .padding() .foregroundColor(.primary) } @@ -48,14 +48,3 @@ struct PickerComponent: Vi } } } - -struct PickerComponent_Previews: PreviewProvider { - @State static var selectedItem = Language.English - static var previews: some View { - PickerComponent( - title: "Select Language:", - selectedOption: $selectedItem, - options: Language.allCases - ) - } -} diff --git a/ArkitDoushiQi/ArkitDoushiQi/InfoTextView.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/InfoTextView.swift similarity index 100% rename from ArkitDoushiQi/ArkitDoushiQi/InfoTextView.swift rename to ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/InfoTextView.swift diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ItemCollectionParty.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ItemCollectionParty.swift index 997236b..785ce32 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ItemCollectionParty.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ItemCollectionParty.swift @@ -9,75 +9,65 @@ import SwiftUI struct ItemCollectionParty: View { var party: Party - + @Environment(\.colorScheme) var colorScheme + var body: some View { VStack { HStack { - Text(party.date) + Text(party.formattedDate) .font(.headline) .foregroundColor(.gray) Spacer() } .padding(.bottom, 5) - GeometryReader { geometry in - HStack(spacing: 10) { - HStack { - Image(party.player1Image) - .resizable() - .aspectRatio(contentMode: .fill) - .frame(width: geometry.size.width * 0.15, height: geometry.size.width * 0.15) - .clipShape(Circle()) - .overlay(Circle().stroke(Color.purple, lineWidth: 2)) + HStack(spacing: 10) { + HStack { + ProfileComponent(color: Color.white, profileWidth: 60, profileHeight: 60, image: Image(party.player1Image)) + + VStack(alignment: .leading) { + Text(party.player1Name) + .fontWeight(.bold) + .foregroundColor(colorScheme == .dark ? .white : .primary) + .lineLimit(1) + .minimumScaleFactor(0.5) + .frame(maxWidth: .infinity, alignment: .leading) - VStack(alignment: .leading) { - Text(party.player1Name) - .fontWeight(.bold) - .foregroundColor(.purple) - .lineLimit(1) - .minimumScaleFactor(0.5) - .frame(maxWidth: geometry.size.width * 0.25, alignment: .leading) - - Text("\(party.player1Score)") - .font(.largeTitle) - .fontWeight(.bold) - .foregroundColor(.green) // Gagnant en vert - } + Text(LocalizedStringKey(party.player1Score)) + .fontWeight(.bold) + .foregroundColor(party.player1Score == "Défaite" ? .red : .green) + .lineLimit(1) + .minimumScaleFactor(0.5) } - - Text("vs") - .font(.headline) - .foregroundColor(.gray) - - HStack { - VStack(alignment: .trailing) { - Text(party.player2Name) - .fontWeight(.bold) - .foregroundColor(.purple) - .lineLimit(1) - .minimumScaleFactor(0.5) - .frame(maxWidth: geometry.size.width * 0.25, alignment: .trailing) - - Text("\(party.player2Score)") - .font(.largeTitle) - .fontWeight(.bold) - .foregroundColor(.red) // Perdant en rouge - } + } + + Text("vs") + .font(.headline) + .foregroundColor(.gray) + + HStack { + VStack(alignment: .trailing) { + Text(party.player2Name) + .fontWeight(.bold) + .foregroundColor(colorScheme == .dark ? .white : .primary) + .lineLimit(1) + .minimumScaleFactor(0.5) + .frame(maxWidth: .infinity, alignment: .trailing) - Image(party.player2Image) - .resizable() - .aspectRatio(contentMode: .fill) - .frame(width: geometry.size.width * 0.15, height: geometry.size.width * 0.15) - .clipShape(Circle()) - .overlay(Circle().stroke(Color.purple, lineWidth: 2)) + Text(LocalizedStringKey(party.player2Score)) + .fontWeight(.bold) + .foregroundColor(party.player2Score == "Victoire" ? .green : .red) + .lineLimit(1) + .minimumScaleFactor(0.5) } + + ProfileComponent(color: Color.white, profileWidth: 60, profileHeight: 60, image: Image(party.player2Image)) } - .padding() - .background(Color.white) - .cornerRadius(15) - .shadow(radius: 3) // Réduction de l'ombre pour un effet plus léger } - .frame(height: 120) // Ajustez la hauteur en fonction de votre contenu + .padding() + .background(Color(UIColor.systemBackground)) + .cornerRadius(15) + .shadow(radius: 3) } .padding(.horizontal) } @@ -85,7 +75,7 @@ struct ItemCollectionParty: View { struct ItemCollectionParty_Previews: PreviewProvider { static var previews: some View { - ItemCollectionParty(party: Party(player1Name: "L'invaincu du samedi", player1Score: 2, player1Image: "Perceval", player2Name: "Le gars du dimanche", player2Score: 1, player2Image: "Perceval", date: "Samedi soir")) + ItemCollectionParty(party: Party(player1Name: "L'invaincu du samedi", player1Score: "Défaite", player1Image: "Perceval", player2Name: "Le gars du dimanche", player2Score: "Victoire", player2Image: "Perceval", date: Date())) .previewLayout(.sizeThatFits) .padding() } diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileComponent.swift index 96e5811..ca88f96 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileComponent.swift @@ -12,6 +12,7 @@ struct ProfileComponent: View { let profileWidth : CGFloat let profileHeight : CGFloat let image : Image + var body: some View { GeometryReader { geometry in ZStack { diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileEdit.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileEdit.swift index 4da9202..26f7fab 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileEdit.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileEdit.swift @@ -2,31 +2,61 @@ // ProfileEdit.swift // ArkitDoushiQi // -// Created by Johan LACHENAL on 28/05/2024. +// Created by Johan LACHENAL, Louis DUFOUR on 28/05/2024. // import SwiftUI +import PhotosUI -struct ProfileEdit: View { - let color : Color - let profileWidth : CGFloat - let profileHeight : CGFloat +struct ProfileEdit: View, KeyboardReadable { + let color: Color + let profileWidth: CGFloat + let profileHeight: CGFloat let defaultImage: Image - let imageTextChange : String + let imageTextChange: LocalizedStringKey + let playerNameKey: LocalizedStringKey + @Binding var playerName: String + @Binding var playerImage: UIImage + @State private var selectedImageItem: PhotosPickerItem? = nil + @State private var keyboardHeight: CGFloat = 0 + @State private var isKeyboardVisible: Bool = false + var body: some View { VStack(alignment: .leading) { - EditImageComponent( - color: color, - profileWidth: profileWidth, - profileHeight: profileHeight, - defaultImage: defaultImage, - imageTextChange: imageTextChange - ).padding(EdgeInsets(top: 0, leading: 32, bottom: 0, trailing: 32)) - VStack(alignment: .trailing) { - HStack { - EditTextComponent(explanation: "Nom du Joueur 1", value: "Joueur 1") + HStack { + Image(uiImage: playerImage) + .resizable() + .aspectRatio(contentMode: .fill) + .frame(width: profileWidth, height: profileHeight) + .clipShape(Circle()) + .overlay(Circle().stroke(color, lineWidth: 2)) + + PhotosPicker(selection: $selectedImageItem, matching: .images) { + Text(imageTextChange) + .foregroundColor(.blue) + .padding(.leading) + } + .onChange(of: selectedImageItem) { newItem in + Task { + if let data = try? await newItem?.loadTransferable(type: Data.self), + let uiImage = UIImage(data: data) { + playerImage = uiImage + } + } } } + .padding(.horizontal) + + EditTextComponent(explanation: playerNameKey, name: $playerName) + .padding(.horizontal) + } + .padding(.bottom, isKeyboardVisible ? keyboardHeight : 0) + .animation(.easeOut(duration: 0.3), value: keyboardHeight) + .onReceive(keyboardPublisher) { height in + withAnimation { + self.keyboardHeight = height + self.isKeyboardVisible = height > 0 + } } } } @@ -37,7 +67,10 @@ struct ProfileEdit_Previews: PreviewProvider { profileWidth: 100, profileHeight: 100, defaultImage: Image("profil"), - imageTextChange: "Changer d'avatar" + imageTextChange: "Changer l'avatar", + playerNameKey: "Nom du Joueur 1", + playerName: .constant("Joueur 1"), + playerImage: .constant(UIImage(named: "profil")!) ) } } diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Data/Stub.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Data/Stub.swift new file mode 100644 index 0000000..39af388 --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Data/Stub.swift @@ -0,0 +1,36 @@ +// +// Stub.swift +// ArkitDoushiQi +// +// Created by Louis DUFOUR on 31/05/2024. +// + +import SwiftUI +import Foundation + +struct Party: Identifiable { + let id = UUID() + let player1Name: String + let player1Score: String + let player1Image: String + let player2Name: String + let player2Score: String + let player2Image: String + let date: Date + + var localizedPlayer1Score: LocalizedStringKey { + LocalizedStringKey(player1Score) + } + + var localizedPlayer2Score: LocalizedStringKey { + LocalizedStringKey(player2Score) + } + + var formattedDate: String { + let dateFormatter = DateFormatter() + dateFormatter.dateStyle = .full + dateFormatter.timeStyle = .none + dateFormatter.locale = Locale.current + return dateFormatter.string(from: date) + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Enum/AI.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Enum/AI.swift index 2569afe..3148fcd 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Enum/AI.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Enum/AI.swift @@ -6,6 +6,7 @@ // import Foundation +import SwiftUI enum AI: String, CaseIterable, Identifiable, Hashable { case RandomAction = "IA Random" @@ -13,4 +14,8 @@ enum AI: String, CaseIterable, Identifiable, Hashable { case MediumTrainedAI = "IA Intermédiaire" var id: String { self.rawValue } + + var localized: LocalizedStringKey { + LocalizedStringKey(self.rawValue) + } } diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Enum/GameType.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Enum/GameType.swift new file mode 100644 index 0000000..537390a --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Enum/GameType.swift @@ -0,0 +1,20 @@ +// +// GameType.swift +// ArkitDoushiQi +// +// Created by Louis DUFOUR on 14/06/2024. +// + +import Foundation +import SwiftUI + +enum GameType: String, CaseIterable, Identifiable, Hashable { + case PvP = "Joueur contre Joueur" + case PvAI = "Joueur contre IA" + + var id: String { self.rawValue } + + var localized: LocalizedStringKey { + LocalizedStringKey(self.rawValue) + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Enum/Rules.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Enum/Rules.swift new file mode 100644 index 0000000..b7343a5 --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Enum/Rules.swift @@ -0,0 +1,20 @@ +// +// Rules.swift +// ArkitDoushiQi +// +// Created by Louis DUFOUR on 14/06/2024. +// + +import Foundation +import SwiftUI + +enum Rules: String, CaseIterable, Identifiable, Hashable { + case Easy = "Simplifié" + case Regular = "Normal" + + var id: String { self.rawValue } + + var localized: LocalizedStringKey { + LocalizedStringKey(self.rawValue) + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/EventTriggers/KeyboardReadable.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/EventTriggers/KeyboardReadable.swift index dec17a6..897a899 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/EventTriggers/KeyboardReadable.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/EventTriggers/KeyboardReadable.swift @@ -2,29 +2,28 @@ // KeyboardReadable.swift // ArkitDoushiQi // -// Created by Johan LACHENAL on 31/05/2024. +// Created by Johan LACHENAL, Louis DUFOUR on 31/05/2024. // -import Foundation import Combine import UIKit - // Publisher to read keyboard changes. protocol KeyboardReadable { - var keyboardPublisher: AnyPublisher { get } + var keyboardPublisher: AnyPublisher { get } } extension KeyboardReadable { - var keyboardPublisher: AnyPublisher { + var keyboardPublisher: AnyPublisher { Publishers.Merge( NotificationCenter.default .publisher(for: UIResponder.keyboardWillShowNotification) - .map { _ in true }, - + .compactMap { notification in + (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect)?.height + }, NotificationCenter.default .publisher(for: UIResponder.keyboardWillHideNotification) - .map { _ in false } + .map { _ in CGFloat(0) } ) .eraseToAnyPublisher() } diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Extension/Placeholder.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Extension/Placeholder.swift new file mode 100644 index 0000000..948fa1b --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Extension/Placeholder.swift @@ -0,0 +1,22 @@ +// +// Placeholder.swift +// ArkitDoushiQi +// +// Created by Louis DUFOUR on 14/06/2024. +// + +import Foundation +import SwiftUI + +extension View { + func placeholder( + when shouldShow: Bool, + alignment: Alignment = .leading, + @ViewBuilder placeholder: () -> Content) -> some View { + + ZStack(alignment: alignment) { + placeholder().opacity(shouldShow ? 1 : 0) + self + } + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift deleted file mode 100644 index 13d6346..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// GameParametersMenuView.swift -// ArkitDoushiQi -// -// Created by Johan LACHENAL on 24/05/2024. -// - -import SwiftUI -import PhotosUI - -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 Rules: String, CaseIterable, Identifiable, Hashable { - case Easy = "Simplifié" - case Regular = "Normal" - var id: String { self.rawValue } -} - -struct GameParametersMenuView: View, KeyboardReadable { - @State private var selectedAIOption: AIT = .RandomAction - @State private var selectedRulesOption: Rules = .Regular - @State private var isKeyboardVisible = false - var body: some View { - NavigationView { - VStack(alignment: .leading) { - HStack(alignment: .center) { - Text("Paramètres de partie").bold().font(.title) - }.frame(maxWidth: .infinity) - PickerComponent(title: "Sélectionne les règles :", - selectedOption: $selectedRulesOption, - options: Rules.allCases) - PickerComponent(title: "Sélectionne une IA :", - selectedOption: $selectedAIOption, - options: AIT.allCases) - ProfileEdit(color: Color(.red), profileWidth: 100, profileHeight: 100, defaultImage: Image("profil"), imageTextChange: "changer l'avatar du joueur 1") - ProfileEdit(color: Color(.blue), profileWidth: 100, profileHeight: 100, defaultImage: Image("profil"), imageTextChange: "changer l'avatar du joueur 2") - if !isKeyboardVisible - { - ButtonComponent(title: "Lancer la partie") { - GameView() - }.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) - } - } - .onReceive(keyboardPublisher) { value in isKeyboardVisible = value } - .frame(maxHeight: .infinity, alignment: .top) - } - } - -} - -struct GameParametersMenuView_Previews: PreviewProvider { - static var previews: some View { - GameParametersMenuView() - } -} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenuView.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenuView.swift new file mode 100644 index 0000000..e3020b7 --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenuView.swift @@ -0,0 +1,68 @@ +// +// GameParametersMenuView.swift +// ArkitDoushiQi +// +// Created by Johan LACHENAL, Louis DUFOUR on 24/05/2024. +// + +import SwiftUI + +struct GameParametersMenuView: View, KeyboardReadable { + @State private var selectedAIOption: AI = .RandomAction + @State private var selectedRulesOption: Rules = .Regular + @State private var selectedGameType: GameType = .PvP + @State private var isKeyboardVisible = false + @State private var playerName1 = NSLocalizedString("Nom du Joueur 1", comment: "") + @State private var playerName2 = NSLocalizedString("Nom du Joueur 2", comment: "") + @State private var playerImage1: UIImage = UIImage(named: "profil")! + @State private var playerImage2: UIImage = UIImage(named: "profil")! + @State private var keyboardHeight: CGFloat = 0 + + var body: some View { + GeometryReader { geometry in + ScrollView { + VStack(alignment: .leading) { + Text("Paramètres de partie") + .bold() + .font(.title) + .padding() + + PickerComponent(title: "Sélectionne le type de partie :", selectedOption: $selectedGameType, options: GameType.allCases) + PickerComponent(title: "Sélectionne les règles :", selectedOption: $selectedRulesOption, options: Rules.allCases) + + if selectedGameType == .PvAI { + PickerComponent(title: "Sélectionne une IA :", selectedOption: $selectedAIOption, options: AI.allCases) + } + + ProfileEdit(color: Color(.red), profileWidth: 100, profileHeight: 100, defaultImage: Image("profil"), imageTextChange: "Changer l'avatar du joueur 1", playerNameKey: "Nom du Joueur 1", playerName: $playerName1, playerImage: $playerImage1) + + if selectedGameType == .PvP { + ProfileEdit(color: Color(.blue), profileWidth: 100, profileHeight: 100, defaultImage: Image("profil"), imageTextChange: "Changer l'avatar du joueur 2", playerNameKey: "Nom du Joueur 2", playerName: $playerName2, playerImage: $playerImage2) + } + + if !isKeyboardVisible { + ButtonComponent(title: "Lancer la partie") { + GameView(player1Name: playerName1, player1Image: playerImage1, player2Name: playerName2, player2Image: playerImage2) + } + .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) + } + } + .padding(.bottom, isKeyboardVisible ? keyboardHeight : 0) + .animation(.easeOut(duration: 0.3), value: keyboardHeight) + .onReceive(keyboardPublisher) { height in + withAnimation { + self.keyboardHeight = height - geometry.safeAreaInsets.bottom + self.isKeyboardVisible = height > 0 + } + } + .frame(minHeight: geometry.size.height) + } + } + } +} + +struct GameParametersMenuView_Previews: PreviewProvider { + static var previews: some View { + GameParametersMenuView() + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/GeneralParametersMenu/GeneralParametersMenuView.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/GeneralParametersMenu/GeneralParametersMenuView.swift deleted file mode 100644 index 1a0862c..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/GeneralParametersMenu/GeneralParametersMenuView.swift +++ /dev/null @@ -1,53 +0,0 @@ -// -// ParametersMenuView.swift -// ArkitDoushiQi -// -// Created by Johan LACHENAL on 21/05/2024. -// - -import SwiftUI - -struct GeneralParametersMenuView: View { - @EnvironmentObject var languageSettings: LanguageSettings - @State private var selectedAIOption: AI - @State private var selectedRulesOption: Rules - - let parametersTitle = LocalizedStringKey("ParametersTitle") - let darkModeDescription = LocalizedStringKey("DarkModeDescription") - let darkModeBooleanName: String = "isDarkMode" - let darkModeDefaultValue: Bool = false - let languagePickerTitle = LocalizedStringKey("LanguagePickerTitle") - - init(selectedAIOption: AI, selectedRulesOption: Rules) { - self._selectedAIOption = State(initialValue: selectedAIOption) - self._selectedRulesOption = State(initialValue: selectedRulesOption) - } - - var body: some View { - VStack(alignment: .leading) { - HStack(alignment: .center) { - Text(parametersTitle).bold().font(.title) - }.frame(maxWidth: .infinity) - Spacer().frame(maxHeight: 30) - ToggleComponent(description: darkModeDescription, booleanName: darkModeBooleanName, booleanDefaultValue: darkModeDefaultValue) - PickerComponent(title: languagePickerTitle, - selectedOption: $languageSettings.selectedLanguage, - options: Language.allCases) - .onChange(of: languageSettings.selectedLanguage) { newLanguage in - languageSettings.changeLanguage(to: newLanguage) - } - } - .frame(maxHeight: .infinity, alignment: .top) - } -} - -struct GeneralParametersMenuView_Previews: PreviewProvider { - static var previews: some View { - let languageSettings = LanguageSettings(selectedLanguage: .French) - GeneralParametersMenuView( - selectedAIOption: .RandomAction, - selectedRulesOption: .Regular - ) - .environmentObject(languageSettings) - } -} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/MainMenu/MainMenu.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/MainMenu/MainMenu.swift deleted file mode 100644 index 0f7ce70..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/MainMenu/MainMenu.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// MainMenu.swift -// ArkitDoushiQi -// -// Created by Johan LACHENAL on 16/05/2024. -// - -import SwiftUI - -struct MainMenu: View { - @EnvironmentObject var languageSettings: LanguageSettings - let playButtonText: String - let registeredGamesButtonText: String - let parametersButtonText: String - @State private var action: Int? = 0 - @AppStorage("isDarkMode") private var isDarkMode = false - @State private var reloadView = false // Déclarer reloadView ici - - var body: some View { - ZStack { - NavigationView { - VStack { - Spacer() - HStack() { - Text("DouShiQi") - .bold() - .font(.title).padding() - } - Spacer().frame(height: 40) - VStack(alignment: .leading) { - ButtonComponent(title: playButtonText) - { GameParametersMenuView() } - Spacer().frame(height: 30) - ButtonComponent(title: registeredGamesButtonText) - { PartyListView() } - Spacer().frame(height: 30) - ButtonComponent(title: parametersButtonText) - { GeneralParametersMenuView( - selectedAIOption: .RandomAction, - selectedRulesOption: .Regular - ).id(reloadView) // Utilisez l'ID pour forcer le rechargement de la vue - } - } - Spacer() - } - .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) - } - .environmentObject(languageSettings) - .onReceive(NotificationCenter.default.publisher(for: NSNotification.Name("LanguageChanged"))) { _ in - self.reloadView.toggle() // Changez la valeur pour forcer le rechargement - } - } - } -} - -struct MainMenu_Previews: PreviewProvider { - static var previews: some View { - MainMenu(playButtonText: "Jouer", registeredGamesButtonText: "Parties enregistrées", parametersButtonText: "Paramètres") - .environmentObject(LanguageSettings(selectedLanguage: .French)) - } -} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery.swift new file mode 100644 index 0000000..c4af4e1 --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery.swift @@ -0,0 +1,41 @@ +// +// PartyEnregistery.swift +// ArkitDoushiQi +// +// Created by Louis DUFOUR on 31/05/2024. +// + +import SwiftUI + +struct PartyListView: View { + let parties: [Party] = [ + Party(player1Name: "Jack", player1Score: "Défaite", player1Image: "Perceval", player2Name: "Le gars du dimanche", player2Score: "Victoire", player2Image: "Perceval", date: Date()), + Party(player1Name: "Le gars du dimanche", player1Score: "Victoire", player1Image: "Perceval", player2Name: "Jack", player2Score: "Défaite", player2Image: "Perceval", date: Date().addingTimeInterval(-86400)) + // Ajoutez plus de parties ici + ] + + var body: some View { + NavigationStack { + List(parties) { party in + ItemCollectionParty(party: party) + .padding(.vertical, 5) + .listRowInsets(EdgeInsets()) // Supprimer le padding + } + .navigationTitle("") + .toolbar { + ToolbarItem(placement: .principal) { + Text("Liste des Parties") + .font(.custom("Nuku Nuku", size: 24)) // Appliquer la police personnalisée ici + .foregroundColor(.primary) // Ajustez la couleur selon vos besoins + } + } + .frame(maxWidth: .infinity) // Utiliser toute la largeur disponible + } + } +} + +struct PartyListView_Previews: PreviewProvider { + static var previews: some View { + PartyListView() + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery/PartyEnregistery.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery/PartyEnregistery.swift deleted file mode 100644 index f459540..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery/PartyEnregistery.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// PartyEnregistery.swift -// ArkitDoushiQi -// -// Created by Louis DUFOUR on 31/05/2024. -// - -import SwiftUI - -import SwiftUI - -struct PartyListView: View { - let parties: [Party] = [ - Party(player1Name: "L'invaincu du samedi", player1Score: 2, player1Image: "Perceval", player2Name: "Le gars du dimanche", player2Score: 1, player2Image: "Perceval", date: "Samedi soir"), - Party(player1Name: "Le champion du vendredi", player1Score: 3, player1Image: "Perceval", player2Name: "Le perdant du lundi", player2Score: 0, player2Image: "Perceval", date: "Vendredi soir") - // Ajoutez plus de parties ici - ] - - var body: some View { - NavigationView { - List(parties) { party in - ItemCollectionParty(party: party) - .padding(.vertical, 5) - } - .navigationTitle("Liste des Parties") - } - } -} - -struct PartyListView_Previews: PreviewProvider { - static var previews: some View { - PartyListView() - } -} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery/Stub.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery/Stub.swift deleted file mode 100644 index 08bac26..0000000 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery/Stub.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// Stub.swift -// ArkitDoushiQi -// -// Created by Louis DUFOUR on 31/05/2024. -// - -import SwiftUI - -struct Party: Identifiable { - let id = UUID() - let player1Name: String - let player1Score: Int - let player1Image: String - let player2Name: String - let player2Score: Int - let player2Image: String - let date: String -} diff --git a/ArkitDoushiQi/Picker.swift b/ArkitDoushiQi/Picker.swift deleted file mode 100644 index 57d1bd5..0000000 --- a/ArkitDoushiQi/Picker.swift +++ /dev/null @@ -1,20 +0,0 @@ -/ -// Picker.swift -// ArkitDoushiQi -// -// Created by Johan LACHENAL on 21/05/2024. -// - -import SwiftUI - -struct Picker: View { - var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) - } -} - -struct Picker_Previews: PreviewProvider { - static var previews: some View { - Picker() - } -} diff --git a/ArkitDoushiQi/Ressources/Font/nuku1.ttf b/ArkitDoushiQi/Ressources/Font/nuku1.ttf new file mode 100644 index 0000000..b2cc8f4 Binary files /dev/null and b/ArkitDoushiQi/Ressources/Font/nuku1.ttf differ diff --git a/ArkitDoushiQi/Ressources/en.lproj/Localizable.strings b/ArkitDoushiQi/Ressources/en.lproj/Localizable.strings new file mode 100644 index 0000000..897dccf --- /dev/null +++ b/ArkitDoushiQi/Ressources/en.lproj/Localizable.strings @@ -0,0 +1,40 @@ +/* + Localizable.strings + ArkitDoushiQi + + Created by Louis DUFOUR on 28/05/2024. + +*/ + +"ParametersTitle" = "Parameters"; +"DarkModeDescription" = "Dark Mode"; +"LanguagePickerTitle" = "Language"; +"DOUSHIQI" = "DOUSHIQI"; +"GAME" = "GAME"; +"Play" = "Play"; +"Registered Games" = "Registered Games"; +"Choose Language" = "Choose Language"; +"French" = "French"; +"English" = "English"; +"Cancel" = "Cancel"; +"Paramètres de partie" = "Game Settings"; +"Sélectionne le type de partie :" = "Select Game Type:"; +"Joueur contre Joueur" = "Player vs Player"; +"Joueur contre IA" = "Player vs AI"; +"Sélectionne les règles :" = "Select Rules:"; +"Simplifié" = "Easy"; +"Normal" = "Regular"; +"Sélectionne une IA :" = "Select AI:"; +"IA Random" = "Random AI"; +"IA Facile" = "Easy AI"; +"IA Intermédiaire" = "Medium AI"; +"changer l'avatar du joueur 1" = "Change Player 1 Avatar"; +"changer l'avatar du joueur 2" = "Change Player 2 Avatar"; +"Nom du Joueur 1" = "Player 1 Name"; +"Nom du Joueur 2" = "Player 2 Name"; +"Lancer la partie" = "Start Game"; +"Changer d'avatar" = "Change Avatar"; +"Liste des Parties" = "Party List"; +"Victoire" = "Victory"; +"Défaite" = "Defeat"; + diff --git a/ArkitDoushiQi/Ressources/fr.lproj/Localizable.strings b/ArkitDoushiQi/Ressources/fr.lproj/Localizable.strings new file mode 100644 index 0000000..e24345e --- /dev/null +++ b/ArkitDoushiQi/Ressources/fr.lproj/Localizable.strings @@ -0,0 +1,40 @@ +/* + Localizable.strings + ArkitDoushiQi + + Created by Louis DUFOUR on 28/05/2024. + +*/ + +"ParametersTitle" = "Paramètres"; +"DarkModeDescription" = "Mode sombre"; +"LanguagePickerTitle" = "Langue"; +"DOUSHIQI" = "DOUSHIQI"; +"GAME" = "JEU"; +"Play" = "Jouer"; +"Registered Games" = "Parties Enregistrees"; +"Choose Language" = "Choisissez la Langue"; +"French" = "Francais"; +"English" = "Anglais"; +"Cancel" = "Annuler"; +"Paramètres de partie" = "Paramètres de partie"; +"Sélectionne le type de partie :" = "Sélectionne le type de partie :"; +"Joueur contre Joueur" = "Joueur contre Joueur"; +"Joueur contre IA" = "Joueur contre IA"; +"Sélectionne les règles :" = "Sélectionne les règles :"; +"Simplifié" = "Simplifié"; +"Normal" = "Normal"; +"Sélectionne une IA :" = "Sélectionne une IA :"; +"IA Random" = "IA Random"; +"IA Facile" = "IA Facile"; +"IA Intermédiaire" = "IA Intermédiaire"; +"changer l'avatar du joueur 1" = "changer l'avatar du joueur 1"; +"changer l'avatar du joueur 2" = "changer l'avatar du joueur 2"; +"Nom du Joueur 1" = "Nom du Joueur 1"; +"Nom du Joueur 2" = "Nom du Joueur 2"; +"Lancer la partie" = "Lancer la partie"; +"Changer d'avatar" = "Changer d'avatar"; +"Liste des Parties" = "Liste des Parties"; +"Liste des Parties" = "Liste des Parties"; +"Victoire" = "Victoire"; +"Défaite" = "Défaite"; diff --git a/ArkitDoushiQi/Ressources/images/background_dark.svg b/ArkitDoushiQi/Ressources/images/background_dark.svg new file mode 100644 index 0000000..7d2ba14 --- /dev/null +++ b/ArkitDoushiQi/Ressources/images/background_dark.svg @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ArkitDoushiQi/Ressources/images/background_light.svg b/ArkitDoushiQi/Ressources/images/background_light.svg new file mode 100644 index 0000000..812ebfe --- /dev/null +++ b/ArkitDoushiQi/Ressources/images/background_light.svg @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ArkitDoushiQi/en.lproj/Localizable.strings b/ArkitDoushiQi/en.lproj/Localizable.strings deleted file mode 100644 index 86edfa0..0000000 --- a/ArkitDoushiQi/en.lproj/Localizable.strings +++ /dev/null @@ -1,11 +0,0 @@ -/* - Localizable.strings - ArkitDoushiQi - - Created by Louis DUFOUR on 28/05/2024. - -*/ - -"ParametersTitle" = "Parameters"; -"DarkModeDescription" = "Dark Mode"; -"LanguagePickerTitle" = "Language"; diff --git a/ArkitDoushiQi/fr.lproj/Localizable.strings b/ArkitDoushiQi/fr.lproj/Localizable.strings deleted file mode 100644 index e309b3b..0000000 --- a/ArkitDoushiQi/fr.lproj/Localizable.strings +++ /dev/null @@ -1,11 +0,0 @@ -/* - Localizable.strings - ArkitDoushiQi - - Created by Louis DUFOUR on 28/05/2024. - -*/ - -"ParametersTitle" = "Paramètres"; -"DarkModeDescription" = "Mode sombre"; -"LanguagePickerTitle" = "Langue";