From 00d3a0a6191b64750cb3483e008159e402fce660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jftg=C6=92?= <fswdg> Date: Tue, 30 May 2023 09:38:41 +0200 Subject: [PATCH] rien --- Pendu.xcodeproj/project.pbxproj | 8 ++++---- Pendu/AppDelegate.swift | 9 +++++---- Pendu/Base.lproj/Main.storyboard | 4 ++-- Pendu/ViewController.swift | 6 +++++- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Pendu.xcodeproj/project.pbxproj b/Pendu.xcodeproj/project.pbxproj index 20b5c50..9cef4cd 100644 --- a/Pendu.xcodeproj/project.pbxproj +++ b/Pendu.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 157E41D92A1D04E400E6DE57 /* zadi.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 157E41D82A1D04E400E6DE57 /* zadi.jpeg */; }; + 157E41DB2A1D136300E6DE57 /* zadi.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 157E41DA2A1D136300E6DE57 /* zadi.jpeg */; }; BF3C480E2A0A1FCA00CE128F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3C480D2A0A1FCA00CE128F /* AppDelegate.swift */; }; BF3C48102A0A1FCA00CE128F /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3C480F2A0A1FCA00CE128F /* SceneDelegate.swift */; }; BF3C48122A0A1FCA00CE128F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3C48112A0A1FCA00CE128F /* ViewController.swift */; }; @@ -42,7 +42,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 157E41D82A1D04E400E6DE57 /* zadi.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = zadi.jpeg; path = ../../zadi.jpeg; sourceTree = "<group>"; }; + 157E41DA2A1D136300E6DE57 /* zadi.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = zadi.jpeg; path = ../../zadi.jpeg; sourceTree = "<group>"; }; BF3C480A2A0A1FCA00CE128F /* Pendu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Pendu.app; sourceTree = BUILT_PRODUCTS_DIR; }; BF3C480D2A0A1FCA00CE128F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; BF3C480F2A0A1FCA00CE128F /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; }; @@ -116,7 +116,7 @@ BF3C48192A0A1FCD00CE128F /* Assets.xcassets */, BF3C481B2A0A1FCD00CE128F /* LaunchScreen.storyboard */, BF3C481E2A0A1FCD00CE128F /* Info.plist */, - 157E41D82A1D04E400E6DE57 /* zadi.jpeg */, + 157E41DA2A1D136300E6DE57 /* zadi.jpeg */, BF3C48162A0A1FCA00CE128F /* Pendu.xcdatamodeld */, D082CCC82A0A33D600D97981 /* GameEngine.swift */, BF3C48422A0A3CFF00CE128F /* GameEngineTests.swift */, @@ -246,8 +246,8 @@ buildActionMask = 2147483647; files = ( BF3C481D2A0A1FCD00CE128F /* LaunchScreen.storyboard in Resources */, - 157E41D92A1D04E400E6DE57 /* zadi.jpeg in Resources */, BF3C481A2A0A1FCD00CE128F /* Assets.xcassets in Resources */, + 157E41DB2A1D136300E6DE57 /* zadi.jpeg in Resources */, BF3C48152A0A1FCA00CE128F /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Pendu/AppDelegate.swift b/Pendu/AppDelegate.swift index f73c543..e5ebafd 100644 --- a/Pendu/AppDelegate.swift +++ b/Pendu/AppDelegate.swift @@ -13,10 +13,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } + func application(_ application: UIApplication, didFinishLaunchingWithOptions + launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } // MARK: UISceneSession Lifecycle diff --git a/Pendu/Base.lproj/Main.storyboard b/Pendu/Base.lproj/Main.storyboard index e8596c7..8edcd76 100644 --- a/Pendu/Base.lproj/Main.storyboard +++ b/Pendu/Base.lproj/Main.storyboard @@ -16,7 +16,7 @@ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="zadi.jpeg" translatesAutoresizingMaskIntoConstraints="NO" id="pv2-ee-Khp"> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="hqdefault.jpeg" translatesAutoresizingMaskIntoConstraints="NO" id="pv2-ee-Khp"> <rect key="frame" x="0.0" y="-43" width="414" height="319"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> </imageView> @@ -91,7 +91,7 @@ </scene> </scenes> <resources> - <image name="zadi.jpeg" width="1928" height="1208"/> + <image name="hqdefault.jpeg" width="480" height="360"/> <systemColor name="systemBackgroundColor"> <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> </systemColor> diff --git a/Pendu/ViewController.swift b/Pendu/ViewController.swift index 058e47c..96f8673 100644 --- a/Pendu/ViewController.swift +++ b/Pendu/ViewController.swift @@ -8,7 +8,7 @@ class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDele @IBOutlet weak var choixNiv: UISegmentedControl! let pickerData = ["Animals", "Sports", "Food", "Cities", "Colors"] - + let gameEngine : GameEngine = GameEngine() override func viewDidLoad() { super.viewDidLoad() choixTheme.dataSource = self @@ -34,6 +34,10 @@ class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDele print("Thème: \(theme)") // Ajoutez votre code supplémentaire ici + let difficulty = niveau ?? "" + + let word = gameEngine.WordToGuess(theme: theme, difficulty: difficulty) + print("Mot à deviner: \(word)") } // MARK: - UIPickerViewDataSource -- GitLab