diff --git a/.drone.yml b/.drone.yml index 0bda882..44a966f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,6 +15,14 @@ steps: - cd ./Sources/bowlin_project/ - flutter build apk + - name: test + image: cirrusci/flutter:stable + commands: + - cd Sources/bowlin_project/ + - flutter pub get + - flutter test --machine --coverage + depends_on: [ app-build ] + # build CONTAINER for sonar on flutter IMAGE - name: code-analysis image: cirrusci/flutter:stable @@ -28,8 +36,8 @@ steps: - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - export PATH=$SONAR_SCANNER_HOME/bin:$PATH - export SONAR_SCANNER_OPTS="-server" - - sonar-scanner -D sonar.projectKey=Bowl_in -D sonar.sources=./Sources/bowlin_project -D sonar.host.url=https://codefirst.iut.uca.fr/sonar - depends_on: [ app-build ] + - sonar-scanner -D sonar.projectKey=Bowl_in -D sonar.sources=./Sources/bowlin_project -D sonar.host.url=https://codefirst.iut.uca.fr/sonar -D sonar.flutter.coverage.reportPath=./Sources/bowlin_project/coverage/lcov.info + depends_on: [ test ] # database container deployment - name: deploy-container-postgresql @@ -48,12 +56,4 @@ steps: from_secret: db_user CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD: from_secret: db_password - ADMINS: emrekartal,louisonparant,davidd_almeida,lucasdelanier,arthurvalin - - name: deploy-adminer - image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest - environment: - IMAGENAME: adminer - CONTAINERNAME: adminer - COMMAND: create - OVERWRITE: true - ADMINS: emrekartal,louisonparant,davidd_almeida,lucasdelanier,arthurvalin \ No newline at end of file + ADMINS: emrekartal,louisonparant,davidd_almeida,lucasdelanier,arthurvalin \ No newline at end of file diff --git a/Documentation/Images/Bowl'in MLD.svg b/Documentation/Images/Bowl'in MLD.svg new file mode 100644 index 0000000..1b0190a --- /dev/null +++ b/Documentation/Images/Bowl'in MLD.svg @@ -0,0 +1,4 @@ + + + +
User
User
Id
Id
Name
Name
Password
Password
Game
Game
Id
Id
#HostId
#HostId
Participe
Participe
#IdGame
#IdGame
Position
Position
#IdUser
#IdUser
GuestName
GuestName
TotalPoints
TotalPoints
Round
Round
#IdGame
#IdGame
#PlayerPosition
#PlayerPosition
TurnNumber
TurnNumber
points
points
Pour une game y'a que 1 joueur en 1 position qui peux être soit un guest soit un user

Si c'est un User on a son Id, sinon on a le nom du guest
Pour une game y'a que 1 joueur en 1...
Un round est identifiée par un numéro de tour d'un Joueur à une certaine position d'une game donnée
Un round est identifiée par un numé...
UserStats
UserStats
#UserId
#UserId
nbVictories
nbVictories
nbGames
nbGames
highscore
highscore
nbStrikes
nbStrikes
nbSpares
nbSpares
avgScore
avgScore
avgPingsPerRound
avgPingsPerRound
Throw
Throw
Order
Order
#Round
#Round
pins
pins
Text is not SVG - cannot display
\ No newline at end of file diff --git a/Documentation/Images/diagramme_de_classe.svg b/Documentation/Images/diagramme_de_classe.svg new file mode 100644 index 0000000..448e1d2 --- /dev/null +++ b/Documentation/Images/diagramme_de_classe.svg @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 913fe47..780372a 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ [![Security Rating](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Bowl_in&metric=security_rating&token=88dd5f9f10bb02aede7a82a2bccf8c987af1ecab)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Bowl_in) [![Vulnerabilities](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Bowl_in&metric=vulnerabilities&token=88dd5f9f10bb02aede7a82a2bccf8c987af1ecab)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Bowl_in) [![Lines of Code](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Bowl_in&metric=ncloc&token=88dd5f9f10bb02aede7a82a2bccf8c987af1ecab)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Bowl_in) +[![Coverage](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Bowl_in&metric=coverage&token=88dd5f9f10bb02aede7a82a2bccf8c987af1ecab)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Bowl_in) + --- diff --git a/Sources/bowlin_project/android/app/src/main/AndroidManifest.xml b/Sources/bowlin_project/android/app/src/main/AndroidManifest.xml index bbddcc8..527f7fe 100644 --- a/Sources/bowlin_project/android/app/src/main/AndroidManifest.xml +++ b/Sources/bowlin_project/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ - - diff --git a/Sources/bowlin_project/android/app/src/main/res/drawable/launch_background.xml b/Sources/bowlin_project/android/app/src/main/res/drawable/launch_background.xml index 8403758..8af0f98 100644 --- a/Sources/bowlin_project/android/app/src/main/res/drawable/launch_background.xml +++ b/Sources/bowlin_project/android/app/src/main/res/drawable/launch_background.xml @@ -3,10 +3,4 @@ - - diff --git a/Sources/bowlin_project/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/Sources/bowlin_project/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index db77bb4..05c8dd0 100644 Binary files a/Sources/bowlin_project/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/Sources/bowlin_project/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/Sources/bowlin_project/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/Sources/bowlin_project/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 17987b7..31593ec 100644 Binary files a/Sources/bowlin_project/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/Sources/bowlin_project/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/Sources/bowlin_project/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/Sources/bowlin_project/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 09d4391..9d216e6 100644 Binary files a/Sources/bowlin_project/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/Sources/bowlin_project/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/Sources/bowlin_project/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Sources/bowlin_project/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index d5f1c8d..b2dbce5 100644 Binary files a/Sources/bowlin_project/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/Sources/bowlin_project/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/Sources/bowlin_project/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Sources/bowlin_project/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 4d6372e..f69b5ed 100644 Binary files a/Sources/bowlin_project/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/Sources/bowlin_project/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/Sources/bowlin_project/android/app/src/main/res/values/styles.xml b/Sources/bowlin_project/android/app/src/main/res/values/styles.xml index 5fac679..45578d6 100644 --- a/Sources/bowlin_project/android/app/src/main/res/values/styles.xml +++ b/Sources/bowlin_project/android/app/src/main/res/values/styles.xml @@ -1,17 +1,10 @@ - - diff --git a/Sources/bowlin_project/ios/Runner.xcodeproj/project.pbxproj b/Sources/bowlin_project/ios/Runner.xcodeproj/project.pbxproj index 5773061..5ca539d 100644 --- a/Sources/bowlin_project/ios/Runner.xcodeproj/project.pbxproj +++ b/Sources/bowlin_project/ios/Runner.xcodeproj/project.pbxproj @@ -1,483 +1,483 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1300; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.bowlinProject; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.bowlinProject; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.bowlinProject; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.bowlinProject; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.bowlinProject; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.bowlinProject; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png index dc9ada4..0e4a9d9 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 7353c41..56b3f92 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 797d452..9fc0676 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index 6ed2d93..d9b1f0c 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cd7b00..3f5c8f9 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index fe73094..2745147 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index 321773c..459f32f 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 797d452..9fc0676 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index 502f463..12a500e 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index 0ec3034..f22ef12 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index 0ec3034..f22ef12 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index e9f5fea..fac200c 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index 84ac32a..8e7b362 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 8953cba..0cbd661 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index 0467bf1..0fc972a 100644 Binary files a/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/Sources/bowlin_project/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/Sources/bowlin_project/lib/config/app_router.dart b/Sources/bowlin_project/lib/config/app_router.dart index 1bc45be..5ac59c7 100644 --- a/Sources/bowlin_project/lib/config/app_router.dart +++ b/Sources/bowlin_project/lib/config/app_router.dart @@ -1,8 +1,6 @@ import 'package:bowl_in/model/AbstractRound.dart'; import 'package:bowl_in/model/GameDetail.dart'; -import 'package:bowl_in/model/Round.dart'; import 'package:bowl_in/views/ingame_screen2.dart'; -import 'package:bowl_in/widgets/button_new_party.dart'; import 'package:flutter/cupertino.dart'; import 'package:go_router/go_router.dart'; diff --git a/Sources/bowlin_project/lib/database/mappers/UserMapper.dart b/Sources/bowlin_project/lib/database/mappers/UserMapper.dart index 97e313c..225753e 100644 --- a/Sources/bowlin_project/lib/database/mappers/UserMapper.dart +++ b/Sources/bowlin_project/lib/database/mappers/UserMapper.dart @@ -1,6 +1,5 @@ -import '../../model/Stat.dart'; import '../../model/User.dart'; -import '../fields/StatFields.dart'; +import '../fields/UserFields.dart'; class UserMapper { static Map toJson(User user) { @@ -20,7 +19,6 @@ class UserMapper { json[UserFields.mail], [], [], - Stat(0,0,0,0,0,0,0,0) ); } } \ No newline at end of file diff --git a/Sources/bowlin_project/lib/database/sqlflite/UserDataBase.dart b/Sources/bowlin_project/lib/database/sqlflite/UserDataBase.dart index b58fc78..9b5393a 100644 --- a/Sources/bowlin_project/lib/database/sqlflite/UserDataBase.dart +++ b/Sources/bowlin_project/lib/database/sqlflite/UserDataBase.dart @@ -6,12 +6,17 @@ import '../fields/UserFields.dart'; import '../mappers/UserMapper.dart'; class UserDatabase { + + UserDatabase(); + static final UserDatabase instance = UserDatabase._init(); static Database? _database; UserDatabase._init(); + static const String tableUser = 'users'; + Future get database async { if (_database != null) return _database!; @@ -27,17 +32,17 @@ class UserDatabase { } Future _createDB(Database db, int version) async { - final idType = 'INTEGER PRIMARY KEY AUTOINCREMENT'; - final textType = 'TEXT NOT NULL'; - final boolType = 'BOOLEAN NOT NULL'; - final integerType = 'INTEGER NOT NULL'; + const idType = 'INTEGER PRIMARY KEY AUTOINCREMENT'; + const textType = 'TEXT NOT NULL'; + const boolType = 'BOOLEAN NOT NULL'; + const integerType = 'INTEGER NOT NULL'; await db.execute(''' CREATE TABLE $tableUser ( ${UserFields.id} $idType, ${UserFields.name} $boolType, - ${UserFields.image} $integerType, - ${UserFields.mail} $textType, + ${UserFields.image} $textType, + ${UserFields.mail} $textType ) '''); } diff --git a/Sources/bowlin_project/lib/main.dart b/Sources/bowlin_project/lib/main.dart index 34c31fe..d6faae1 100644 --- a/Sources/bowlin_project/lib/main.dart +++ b/Sources/bowlin_project/lib/main.dart @@ -1,16 +1,9 @@ import 'package:bowl_in/model/LocalManager/LocalData.dart'; -import 'package:bowl_in/views/game_screen.dart'; -import 'package:bowl_in/views/ingame_screen.dart'; -import 'package:bowl_in/views/main_screen.dart'; -import 'package:bowl_in/views/rank_screen.dart'; -import 'package:bowl_in/views/welcome_screen.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:go_router/go_router.dart'; import 'package:bowl_in/config/app_router.dart'; import 'model/IManager.dart'; -import 'model/StubManager/StubData.dart'; void main() { runApp(const MyApp()); @@ -18,7 +11,9 @@ void main() { class MyApp extends StatelessWidget { static IManager controller = LocalData(); + const MyApp({super.key}); + @override Widget build(BuildContext context) { SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); @@ -30,7 +25,7 @@ class MyApp extends StatelessWidget { ); } - // This widget is the root of your application. +// This widget is the root of your application. } class MyHomePage extends StatefulWidget { diff --git a/Sources/bowlin_project/lib/model/AbstractRound.dart b/Sources/bowlin_project/lib/model/AbstractRound.dart index b636611..b5293db 100644 --- a/Sources/bowlin_project/lib/model/AbstractRound.dart +++ b/Sources/bowlin_project/lib/model/AbstractRound.dart @@ -1,5 +1,7 @@ import 'Player.dart'; +final maxScoreInFrame = 30; + abstract class AbstractRound { int? _firstThrow; int? _secondThrow; @@ -28,7 +30,11 @@ abstract class AbstractRound { int? get points => _points; set points(int? value) { - _points = value; + if((value??0)>=maxScoreInFrame){ + _points=maxScoreInFrame; + }else { + _points = value; + } } @@ -76,11 +82,14 @@ abstract class AbstractRound { } void update(int val){ + print(" ROUND " + number.toString() + "UPDATE : " + val.toString()); + points = (points ?? 0) + val; previousRound?.update(val); } void unsubscribePreviousRound(){ + print("UNSUBSCRIBE"); previousRound?.unsubscribePreviousRound(); previousRound=null; } diff --git a/Sources/bowlin_project/lib/model/Game.dart b/Sources/bowlin_project/lib/model/Game.dart index 8f6c909..7c73eee 100644 --- a/Sources/bowlin_project/lib/model/Game.dart +++ b/Sources/bowlin_project/lib/model/Game.dart @@ -1,44 +1,17 @@ import 'Player.dart'; class Game { - int _id; - DateTime _date; - int _pointsCurrentUser; - bool _isFinished; - List _players = []; + final int _id; + final DateTime _date; + final int _pointsCurrentUser; + final List _players; // Constructor - Game(this._id, this._date, this._pointsCurrentUser, this._isFinished, + Game(this._id, this._date, this._pointsCurrentUser, this._players); - // Getters and setters int get id => _id; - - set id(int value) { - _id = value; - } - DateTime get date => _date; - - set date(DateTime value) { - _date = value; - } - int get pointsCurrentUser => _pointsCurrentUser; - - set pointsCurrentUser(int value) { - _pointsCurrentUser = value; - } - - bool get isFinished => _isFinished; - - set isFinished(bool value) { - _isFinished = value; - } - List get players => _players; - - set playersId(List value) { - _players = value; - } } diff --git a/Sources/bowlin_project/lib/model/GameDetail.dart b/Sources/bowlin_project/lib/model/GameDetail.dart index 4b159e9..51c0cd4 100644 --- a/Sources/bowlin_project/lib/model/GameDetail.dart +++ b/Sources/bowlin_project/lib/model/GameDetail.dart @@ -1,26 +1,21 @@ import 'package:bowl_in/model/AbstractRound.dart'; import 'package:bowl_in/model/Game.dart'; -import 'package:bowl_in/model/GamePlayer.dart'; import 'package:bowl_in/model/LastRound.dart'; - import 'Player.dart'; import 'Round.dart'; import 'User.dart'; class GameDetail { int _id; - DateTime _time; + final DateTime _time; Player? _winner; - int _nbPoints; - bool _isFinished; - int _host; - List _rounds = []; - List _players = []; + final int _host; + final List _rounds = []; + final List _players; final Map _points = {}; // Constructor - GameDetail(this._id, this._time, this._winner, this._nbPoints, - this._isFinished, this._host, this._players) { + GameDetail(this._id, this._time, this._winner, this._host, this._players) { for (int i = 1; i <= 9; i++) { players.forEach((element) { this.rounds.add(Round(null, null, 0, element, i)); @@ -29,7 +24,6 @@ class GameDetail { players.forEach((element) { this.rounds.add(LastRound(null, null, 0, element, 10, null)); }); - } // Getters and setters @@ -41,75 +35,48 @@ class GameDetail { DateTime get time => _time; - set time(DateTime value) { - _time = value; - } - Player? get winner => _winner; set winner(Player? value) { _winner = value; } - int get nbPoints => _nbPoints; - - set nbPoints(int value) { - _nbPoints = value; - } - - bool get isFinished => _isFinished; - - set isFinished(bool value) { - _isFinished = value; - } - int get host => _host; - set host(int value) { - _host = value; - } - List get rounds => _rounds; - set rounds(List value) { - _rounds = value; - } - List get players => _players; - set players(List value) { - _players = value; - } - - Map get points => _points; - void addGameToUsers(){ - for(var p in players){ - if(p is User){ - p.games.add(Game(this.id, this.time, points[p] ?? 0, true, players)); + void addGameToUsers() { + for (var p in players) { + if (p is User) { + p.games.add(Game(this.id, this.time, points[p] ?? 0, players)); p.stat.updateStats(this, p); } } } - void computeWinner(){ + void computeWinner() { print(getRank().entries.first.key.name); this.winner = getRank().entries.first.key; } - void computeScores(){ + void computeScores() { print("====COMPUTE POINTS===="); - for(var element in rounds){ - points[element.player] = (points[element.player] ?? 0) + (element.points ?? 0); + for (var element in rounds) { + points[element.player] = + (points[element.player] ?? 0) + (element.points ?? 0); + print(element.points); } computeWinner(); addGameToUsers(); } Map getRank() { - var sortedByValueMap = Map.fromEntries( - points.entries.toList()..sort((e1, e2) => e2.value.compareTo(e1.value))); + var sortedByValueMap = Map.fromEntries(points.entries.toList() + ..sort((e1, e2) => e2.value.compareTo(e1.value))); return sortedByValueMap; } } diff --git a/Sources/bowlin_project/lib/model/GamePlayer.dart b/Sources/bowlin_project/lib/model/GamePlayer.dart index 8deb5c6..61af1ad 100644 --- a/Sources/bowlin_project/lib/model/GamePlayer.dart +++ b/Sources/bowlin_project/lib/model/GamePlayer.dart @@ -1,3 +1,4 @@ +import 'package:bowl_in/model/AbstractRound.dart'; import 'package:bowl_in/model/IManager.dart'; import 'package:flutter/cupertino.dart'; @@ -20,7 +21,14 @@ class GamePlayer { _game = value; } - void onNext(bool isRoundFinished, BuildContext context) { + AbstractRound? get currentRound { + if (currentRoundIndex < game.rounds.length){ + return game.rounds[currentRoundIndex]; + } + return null; + } + + void onNext(bool isRoundFinished, BuildContext? context) { if (isRoundFinished) { print("++"); currentRoundIndex++; @@ -32,7 +40,7 @@ class GamePlayer { _parent.gameMgr.addGame(game); game.computeScores(); - context.go("/scoreboard", extra: game); + context?.go("/scoreboard", extra: game); } else { print("IN GAME : " + currentRoundIndex.toString()); if (game.rounds[currentRoundIndex] is Round) { @@ -40,7 +48,7 @@ class GamePlayer { } else { print("LAST ROUND"); } - context.pushReplacement("/in-game", + context?.pushReplacement("/in-game", extra: game.rounds[currentRoundIndex]); } } diff --git a/Sources/bowlin_project/lib/model/IGameManager.dart b/Sources/bowlin_project/lib/model/IGameManager.dart index 6040d3c..2b4eff8 100644 --- a/Sources/bowlin_project/lib/model/IGameManager.dart +++ b/Sources/bowlin_project/lib/model/IGameManager.dart @@ -1,9 +1,7 @@ import 'GameDetail.dart'; import 'Player.dart'; -import 'User.dart'; abstract class IGameManager { - // Methods GameDetail getGameById(int id); List getGamesByPlayerId(int id); List getGamesByPlayer(Player user); diff --git a/Sources/bowlin_project/lib/model/IManager.dart b/Sources/bowlin_project/lib/model/IManager.dart index 3b1932f..c48e2a6 100644 --- a/Sources/bowlin_project/lib/model/IManager.dart +++ b/Sources/bowlin_project/lib/model/IManager.dart @@ -1,6 +1,5 @@ import 'package:bowl_in/model/GameDetail.dart'; import 'package:bowl_in/model/GamePlayer.dart'; - import 'User.dart'; import 'IUserManager.dart'; import 'IGameManager.dart'; @@ -8,9 +7,9 @@ import 'IGameManager.dart'; abstract class IManager { late User _userCurrent; late GameDetail _gameCurrent; - late GamePlayer _gamePlayer = GamePlayer(this); - late IUserManager _userMgr; - late IGameManager _gameMgr; + late final GamePlayer _gamePlayer = GamePlayer(this); + late final IUserManager _userMgr; + late final IGameManager _gameMgr; // Getters and setters User get userCurrent => _userCurrent; @@ -21,10 +20,6 @@ abstract class IManager { GamePlayer get gamePlayer => _gamePlayer; - set gamePlayer(GamePlayer value) { - _gamePlayer = value; - } - GameDetail get gameCurrent => _gameCurrent; set gameCurrent(GameDetail value) { @@ -32,5 +27,14 @@ abstract class IManager { } IUserManager get userMgr => _userMgr; + IGameManager get gameMgr => _gameMgr; + + set gameMgr(IGameManager value) { + _gameMgr = value; + } + + set userMgr(IUserManager value) { + _userMgr = value; + } } diff --git a/Sources/bowlin_project/lib/model/LastRound.dart b/Sources/bowlin_project/lib/model/LastRound.dart index 71cbb86..5448035 100644 --- a/Sources/bowlin_project/lib/model/LastRound.dart +++ b/Sources/bowlin_project/lib/model/LastRound.dart @@ -1,11 +1,10 @@ import 'package:bowl_in/model/AbstractRound.dart'; -import 'Player.dart'; - -class LastRound extends AbstractRound{ +class LastRound extends AbstractRound { int? _thirdThrow; - LastRound(super.firstThrow, super.secondThrow, super.points, super.player, super.number, this._thirdThrow); + LastRound(super.firstThrow, super.secondThrow, super.points, super.player, + super.number, this._thirdThrow); int? get thirdThrow => _thirdThrow; @@ -15,21 +14,21 @@ class LastRound extends AbstractRound{ @override bool computeNext(int val) { - if(firstThrow==null){ - firstThrow=val; - if(previousRound?.isSpare() ?? false){ + if (firstThrow == null) { + firstThrow = val; + if (previousRound?.isSpare() ?? false) { previousRound?.update(val); } return false; - }else if(secondThrow==null){ - secondThrow=val; - if ((firstThrow??0)+(secondThrow??0)<10){ + } else if (secondThrow == null) { + secondThrow = val; + if ((firstThrow ?? 0) + (secondThrow ?? 0) < 10) { computePoints(); - return true ; + return true; } return false; - }else if((firstThrow??0)+(secondThrow??0)>=10){ - thirdThrow=val; + } else if ((firstThrow ?? 0) + (secondThrow ?? 0) >= 10) { + thirdThrow = val; } computePoints(); return true; @@ -37,35 +36,36 @@ class LastRound extends AbstractRound{ @override void computePoints() { - points = (firstThrow??0)+(secondThrow??0)+(thirdThrow??0); + points = (firstThrow ?? 0) + (secondThrow ?? 0) + (thirdThrow ?? 0); + print("Compute points : " + points.toString()); - if(previousRound?.isStrike()??false){ - update(points??0); + if (previousRound?.isStrike() ?? false) { + update(points ?? 0); } unsubscribePreviousRound(); } @override - bool shotIsStrike(){ - if(firstThrow==null){ + bool shotIsStrike() { + if (firstThrow == null) { return true; - }else if(secondThrow==null){ - return firstThrow==10; - }else{ - return secondThrow==10; + } else if (secondThrow == null) { + return firstThrow == 10; + } else { + return secondThrow == 10; } } @override int getNbSpares() { int nb = 0; - if(firstThrow!=10){ - if((firstThrow??0)+(secondThrow??0)==10){ - nb+=1; + if (firstThrow != 10) { + if ((firstThrow ?? 0) + (secondThrow ?? 0) == 10) { + nb += 1; } - }else{ - if((thirdThrow??0)+(secondThrow??0)==10) { - nb+=1; + } else { + if ((thirdThrow ?? 0) + (secondThrow ?? 0) == 10) { + nb += 1; } } return nb; @@ -74,17 +74,17 @@ class LastRound extends AbstractRound{ @override int getNbStrike() { int nb = 0; - if(firstThrow==10){ - nb+=1; - if(secondThrow==10){ - nb+=1; - if(thirdThrow==10) { - nb+=1; + if (firstThrow == 10) { + nb += 1; + if (secondThrow == 10) { + nb += 1; + if (thirdThrow == 10) { + nb += 1; } } - }else{ - if(thirdThrow==10) { - nb+=1; + } else { + if (thirdThrow == 10) { + nb += 1; } } return nb; @@ -92,23 +92,21 @@ class LastRound extends AbstractRound{ @override int getPinsKnockedDown() { - return (firstThrow??0)+(secondThrow??0)+(thirdThrow??0); + return (firstThrow ?? 0) + (secondThrow ?? 0) + (thirdThrow ?? 0); } - @override int getMaxPinsThisShot() { - if(firstThrow==null){ + if (firstThrow == null) { return 10; - }else if(firstThrow==10 && secondThrow==null){ + } else if (firstThrow == 10 && secondThrow == null) { return 10; - }else if(secondThrow==null){ - return 10 - (firstThrow??0); - }else if(secondThrow==10){ + } else if ( secondThrow == null ){ + return 10 - ( firstThrow ?? 0 ); + } else if ( ( firstThrow ?? 0 ) + ( secondThrow ?? 0 ) == 10 || secondThrow == 10 ){ return 10; - }else{ - return 10 - (secondThrow??0); + } else { + return 10 - ( secondThrow ?? 0 ); } } - } diff --git a/Sources/bowlin_project/lib/model/LocalManager/LocalData.dart b/Sources/bowlin_project/lib/model/LocalManager/LocalData.dart index ad3ef50..a10fc94 100644 --- a/Sources/bowlin_project/lib/model/LocalManager/LocalData.dart +++ b/Sources/bowlin_project/lib/model/LocalManager/LocalData.dart @@ -1,24 +1,13 @@ import 'package:bowl_in/model/IManager.dart'; -import 'package:localstorage/localstorage.dart'; - -import '../IGameManager.dart'; -import '../IUserManager.dart'; +import '../../database/sqlflite/UserDataBase.dart'; import 'GameManager.dart'; import 'UserManager.dart'; -class LocalData extends IManager{ - late IUserManager _userMgr; - late IGameManager _gameMgr; - - final LocalStorage storage = LocalStorage('local_key'); +class LocalData extends IManager { + final UserDatabase userDatabase = UserDatabase(); LocalData() { - _userMgr = UserManager(this); - _gameMgr = GameManager(this); + userMgr = UserManager(this); + gameMgr = GameManager(this); } - - IUserManager get userMgr => _userMgr; - - IGameManager get gameMgr => _gameMgr; - -} \ No newline at end of file +} diff --git a/Sources/bowlin_project/lib/model/LocalManager/UserManager.dart b/Sources/bowlin_project/lib/model/LocalManager/UserManager.dart index 962ea22..1386929 100644 --- a/Sources/bowlin_project/lib/model/LocalManager/UserManager.dart +++ b/Sources/bowlin_project/lib/model/LocalManager/UserManager.dart @@ -1,11 +1,7 @@ -import 'dart:convert'; - import 'package:bowl_in/model/IUserManager.dart'; import 'package:bowl_in/model/LocalManager/LocalData.dart'; import 'package:bowl_in/model/Player.dart'; import 'package:bowl_in/model/User.dart'; - -import '../Stat.dart'; import 'AuthManager.dart'; class UserManager extends IUserManager { @@ -13,42 +9,25 @@ class UserManager extends IUserManager { // Constructor UserManager(this.parent) : super(AuthManager(parent)) { + saveUser( + User(0, "Lucas", "./assets/images/image_user_red.png", "", [], [])); _initUser(); } _initUser() async { - var userJson = await parent.storage.getItem('user'); - if (userJson == null || userJson =='') { - User user2 = User( - 1, - "Unknown", - "./assets/images/image_user_cyan.png", - "", - [], - [], - Stat(0, 0, 0, 0, 0, 0, 0, 0)); - parent.userCurrent = user2; - - + var user = await parent.userDatabase.readUser(0); + if (user == null) { + User user2 = + User(1, "Unknown", "./assets/images/image_user_cyan.png", "", [], []); + parent.userCurrent = user2; } else { - Map userMap = json.decode(userJson); - User user = User( - userMap['_id'], - userMap['name'], - userMap['image'], - userMap['_mail'], - [], - [], - Stat(0, 0, 0, 0, 0, 0, 2.0, 3.0), - ); parent.userCurrent = user; } } saveUser(User user) { - String userJson = json.encode(userToMap(user)); - - parent.storage.setItem('user', userJson); + parent.userDatabase.deleteUser(0); + parent.userDatabase.createUser(user); } Map userToMap(User user) { diff --git a/Sources/bowlin_project/lib/model/Round.dart b/Sources/bowlin_project/lib/model/Round.dart index 6e1d9c3..3b50946 100644 --- a/Sources/bowlin_project/lib/model/Round.dart +++ b/Sources/bowlin_project/lib/model/Round.dart @@ -1,25 +1,24 @@ import 'package:bowl_in/model/AbstractRound.dart'; -import 'GamePlayer.dart'; -class Round extends AbstractRound{ - - Round(super.firstThrow, super.secondThrow, super.points, super.player, super.number); +class Round extends AbstractRound { + Round(super.firstThrow, super.secondThrow, super.points, super.player, + super.number); @override bool computeNext(int val) { - if(firstThrow==null){ - firstThrow=val; - if(previousRound?.isSpare() ?? false){ + if (firstThrow == null) { + firstThrow = val; + if (previousRound?.isSpare() ?? false) { previousRound?.update(val); unsubscribePreviousRound(); } - if(val==10){ + if (val == 10) { computePoints(); return true; } return false; - }else if(firstThrow!=10 && secondThrow==null){ - secondThrow=val; + } else if (firstThrow != 10 && secondThrow == null) { + secondThrow = val; } computePoints(); return true; @@ -27,21 +26,20 @@ class Round extends AbstractRound{ @override void computePoints() { - points = (firstThrow ?? 0)+(secondThrow ?? 0); - if(previousRound?.isStrike() ?? false){ + points = (firstThrow ?? 0) + (secondThrow ?? 0); + if (previousRound?.isStrike() ?? false) { previousRound?.update(points ?? 0); } - unsubscribePreviousRound(); } @override - bool shotIsStrike(){ - return firstThrow==null; + bool shotIsStrike() { + return firstThrow == null; } @override int getNbSpares() { - if(isSpare()){ + if (isSpare()) { return 1; } return 0; @@ -49,7 +47,7 @@ class Round extends AbstractRound{ @override int getNbStrike() { - if(isStrike()){ + if (isStrike()) { return 1; } return 0; @@ -57,14 +55,14 @@ class Round extends AbstractRound{ @override int getPinsKnockedDown() { - return (firstThrow ?? 0)+(secondThrow ?? 0); + return (firstThrow ?? 0) + (secondThrow ?? 0); } @override int getMaxPinsThisShot() { - if(firstThrow==null){ + if (firstThrow == null) { return 10; - }else{ + } else { return 10 - (firstThrow ?? 0); } } diff --git a/Sources/bowlin_project/lib/model/Stat.dart b/Sources/bowlin_project/lib/model/Stat.dart index 6cf57b4..e2e3d91 100644 --- a/Sources/bowlin_project/lib/model/Stat.dart +++ b/Sources/bowlin_project/lib/model/Stat.dart @@ -1,17 +1,15 @@ import 'package:bowl_in/model/GameDetail.dart'; import 'package:bowl_in/model/Player.dart'; -import 'User.dart'; - class Stat { - int _nbVictory; - int _nbGames; - int _highscore; - int _nbStrikes; - int _nbSpares; - int _nbScore; - double _avgScore; - double _avgPinsPerRound; + int _nbVictory = 0; + int _nbGames = 0; + int _highscore = 0; + int _nbStrikes = 0; + int _nbSpares = 0; + int _nbScore = 0; + double _avgScore = 0; + double _avgPinsPerRound = 0; // Constructor Stat( @@ -25,6 +23,9 @@ class Stat { this._avgPinsPerRound, ); + Stat.empty(); + + // Getters and setters int get nbVictory => _nbVictory; @@ -74,39 +75,26 @@ class Stat { _avgPinsPerRound = value; } - void updateStats(GameDetail gd, Player p){ - nbGames +=1; - if(gd.winner == p){ - nbVictory +=1; + void updateStats(GameDetail gd, Player p) { + nbGames += 1; + if (gd.winner == p) { + nbVictory += 1; } - if((gd.points[p] ?? 0) > highscore){ + if ((gd.points[p] ?? 0) > highscore) { highscore = gd.points[p] ?? 0; } double totalpins = 0; - for(var r in gd.rounds){ - - if(p == r.player){ + for (var r in gd.rounds) { + if (p == r.player) { nbStrikes += r.getNbStrike(); nbSpares += r.getNbSpares(); totalpins = totalpins + r.getPinsKnockedDown(); } } - avgPinsPerRound = ((avgPinsPerRound * (nbGames-1)) + (totalpins/10))/nbGames; - + avgPinsPerRound = + ((avgPinsPerRound * (nbGames - 1)) + (totalpins / 10)) / nbGames; } - - // Serialize to JSON - Map toJson() => { - 'nbVictory': nbVictory, - 'nbGames': nbGames, - 'highscore': highscore, - 'nbStrikes': nbStrikes, - 'nbSpares': nbSpares, - 'nbScore': nbScore, - 'avgScore': avgScore, - 'avgPinsPerRound': avgPinsPerRound, - }; } diff --git a/Sources/bowlin_project/lib/model/StubManager/AuthManager.dart b/Sources/bowlin_project/lib/model/StubManager/AuthManager.dart index bb63f3f..cee989e 100644 --- a/Sources/bowlin_project/lib/model/StubManager/AuthManager.dart +++ b/Sources/bowlin_project/lib/model/StubManager/AuthManager.dart @@ -14,7 +14,7 @@ class AuthManager extends IAuthManager { bool verifiedUser(String mail, String password) { for (var user in parent.players) { if (user is User && user.mail == mail) { - parent.userCurrent = user as User; + parent.userCurrent = user; return true; } } diff --git a/Sources/bowlin_project/lib/model/StubManager/GameManager.dart b/Sources/bowlin_project/lib/model/StubManager/GameManager.dart index 511acaf..63c878e 100644 --- a/Sources/bowlin_project/lib/model/StubManager/GameManager.dart +++ b/Sources/bowlin_project/lib/model/StubManager/GameManager.dart @@ -1,11 +1,9 @@ library StubLib; -import '../Game.dart'; import '../IGameManager.dart'; import '../GameDetail.dart'; import '../Player.dart'; import '../User.dart'; -import '../Guest.dart'; import 'StubData.dart'; class GameManager extends IGameManager { diff --git a/Sources/bowlin_project/lib/model/StubManager/StubData.dart b/Sources/bowlin_project/lib/model/StubManager/StubData.dart index ae95609..d5d36f8 100644 --- a/Sources/bowlin_project/lib/model/StubManager/StubData.dart +++ b/Sources/bowlin_project/lib/model/StubManager/StubData.dart @@ -2,35 +2,24 @@ library StubLib; import '../Guest.dart'; import '../IManager.dart'; -import '../Game.dart'; -import '../IUserManager.dart'; -import '../IGameManager.dart'; import '../Player.dart'; import '../Round.dart'; import '../User.dart'; import '../Achievement.dart'; import '../GameDetail.dart'; -import '../Stat.dart'; import 'UserManager.dart'; import 'GameManager.dart'; class StubData extends IManager { - late IUserManager _userMgr; - late IGameManager _gameMgr; - StubData() { - _userMgr = UserManager(this); - _gameMgr = GameManager(this); + userMgr = UserManager(this); + gameMgr = GameManager(this); _initRounds(); _initGameDetails(); _initGame(); userCurrent = players[8] as User; } - IUserManager get userMgr => _userMgr; - - IGameManager get gameMgr => _gameMgr; - List players = [ Guest("Mathieu"), Guest("Robin"), @@ -39,91 +28,49 @@ class StubData extends IManager { Guest("Louison"), Guest("Arthur"), Guest("David"), - User( - 8, - "Emre", - "./assets/images/image_user_cyan.png", - "emre.kartal@etu.uca.fr", - [ - Achievement("5 games"), - Achievement("2 strikes in a row"), - Achievement("Win a game") - ], - [], - Stat(0, 0, 0, 0, 0, 0, 0, 0)), - User( - 9, - "Dave", - "./assets/images/image_user_cyan.png", - "david.d_almeida@etu.uca.fr", - [ - Achievement("5 games"), - Achievement("0 point"), - Achievement("Win a game") - ], - [ - User( - 21, - "Arthur", - "./assets/images/image_user_cyan.png", - "emre.kartal@etu.uca.fr", - [ - Achievement("5 games"), - Achievement("2 strikes in a row"), - Achievement("Win a game") - ], - [], - Stat(0, 0, 0, 0, 0, 0, 0, 0)), - User( - 22, - "Louison", - "./assets/images/image_user_cyan.png", - "emre.kartal@etu.uca.fr", - [ - Achievement("5 games"), - Achievement("2 strikes in a row"), - Achievement("Win a game") - ], - [], - Stat(10, 12, 150, 7, 6, 700, 58.33, 30.2)), - User( - 23, - "Owen", - "./assets/images/image_user_cyan.png", - "emre.kartal@etu.uca.fr", - [ - Achievement("5 games"), - Achievement("2 strikes in a row"), - Achievement("Win a game") - ], - [], - Stat(10, 12, 10, 7, 6, 700, 58.33, 30.2)), - User( - 24, - "LULU", - "./assets/images/image_user_cyan.png", - "emre.kartal@etu.uca.fr", - [ - Achievement("5 games"), - Achievement("2 strikes in a row"), - Achievement("Win a game") - ], - [], - Stat(10, 12, 40, 7, 6, 700, 58.33, 30.2)), - User( - 25, - "Raphael", - "./assets/images/image_user_cyan.png", - "emre.kartal@etu.uca.fr", - [ - Achievement("5 games"), - Achievement("2 strikes in a row"), - Achievement("Win a game") - ], - [], - Stat(10, 12, 76, 7, 6, 700, 58.33, 30.2)), - ], - Stat(0, 0, 0, 0, 0, 0, 0, 0)) + User(8, "Emre", "./assets/images/image_user_cyan.png", + "emre.kartal@etu.uca.fr", [ + Achievement("5 games"), + Achievement("2 strikes in a row"), + Achievement("Win a game") + ], []), + User(9, "Dave", "./assets/images/image_user_cyan.png", + "david.d_almeida@etu.uca.fr", [ + Achievement("5 games"), + Achievement("0 point"), + Achievement("Win a game") + ], [ + User(21, "Arthur", "./assets/images/image_user_cyan.png", + "emre.kartal@etu.uca.fr", [ + Achievement("5 games"), + Achievement("2 strikes in a row"), + Achievement("Win a game") + ], []), + User(22, "Louison", "./assets/images/image_user_cyan.png", + "emre.kartal@etu.uca.fr", [ + Achievement("5 games"), + Achievement("2 strikes in a row"), + Achievement("Win a game") + ], []), + User(23, "Owen", "./assets/images/image_user_cyan.png", + "emre.kartal@etu.uca.fr", [ + Achievement("5 games"), + Achievement("2 strikes in a row"), + Achievement("Win a game") + ], []), + User(24, "LULU", "./assets/images/image_user_cyan.png", + "emre.kartal@etu.uca.fr", [ + Achievement("5 games"), + Achievement("2 strikes in a row"), + Achievement("Win a game") + ], []), + User(25, "Raphael", "./assets/images/image_user_cyan.png", + "emre.kartal@etu.uca.fr", [ + Achievement("5 games"), + Achievement("2 strikes in a row"), + Achievement("Win a game") + ], []), + ]) ]; List _gameDetails = []; @@ -172,8 +119,6 @@ class StubData extends IManager { List get rounds => _rounds; - List _games = []; - void _initGame() { // games.add(Game( // gameDetails[0].id, diff --git a/Sources/bowlin_project/lib/model/StubManager/UserManager.dart b/Sources/bowlin_project/lib/model/StubManager/UserManager.dart index c4e7f57..fd8d9e9 100644 --- a/Sources/bowlin_project/lib/model/StubManager/UserManager.dart +++ b/Sources/bowlin_project/lib/model/StubManager/UserManager.dart @@ -1,13 +1,10 @@ library StubLib; import '../IUserManager.dart'; -import '../IAuthManager.dart'; import '../Player.dart'; import '../User.dart'; import 'AuthManager.dart'; import 'StubData.dart'; -import '../Player.dart'; -import '../Stat.dart'; class UserManager extends IUserManager { final StubData parent; diff --git a/Sources/bowlin_project/lib/model/User.dart b/Sources/bowlin_project/lib/model/User.dart index 0b0a8b9..fb1c2ac 100644 --- a/Sources/bowlin_project/lib/model/User.dart +++ b/Sources/bowlin_project/lib/model/User.dart @@ -10,12 +10,12 @@ class User extends Player { String _mail; List _achievements = []; List _friends = []; - Stat _stat; + final Stat _stat = Stat.empty(); List games = []; // Constructor User(this._id, String name, String image, this._mail, this._achievements, - this._friends, this._stat) + this._friends) : super(name, image); int get id => _id; @@ -41,8 +41,4 @@ class User extends Player { Stat get stat => _stat; - set stat(Stat value) { - _stat = value; - } - } diff --git a/Sources/bowlin_project/lib/views/ingame_screen.dart b/Sources/bowlin_project/lib/views/ingame_screen.dart index 6a47b3c..8d21a2d 100644 --- a/Sources/bowlin_project/lib/views/ingame_screen.dart +++ b/Sources/bowlin_project/lib/views/ingame_screen.dart @@ -1,17 +1,10 @@ import 'package:bowl_in/main.dart'; import 'package:bowl_in/model/GameDetail.dart'; -import 'package:bowl_in/model/GamePlayer.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; - -import '../model/Game.dart'; -import '../model/Guest.dart'; import '../model/Player.dart'; -import '../widgets/button_new_party.dart'; import '../widgets/ingame_widgets.dart'; -import '../widgets/scores_list_widget.dart'; class InGameScreen extends StatefulWidget { const InGameScreen({Key? key}) : super(key: key); @@ -57,12 +50,7 @@ class _InGameScreenState extends State { Spacer(), ElevatedButton( onPressed: () { - GameDetail gd = GameDetail( - -1, - DateTime.now(), - null, - 0, - false, + GameDetail gd = GameDetail(-1, DateTime.now(), null, MyApp.controller.userCurrent.id, listPlayers); MyApp.controller.gamePlayer.game = gd; @@ -81,8 +69,8 @@ class _InGameScreenState extends State { width: 7, color: Color(0xff1ABAE0), ), - onPrimary: Colors.transparent, - primary: Colors.transparent, + backgroundColor: Colors.transparent, + foregroundColor: Colors.transparent, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(55), ), diff --git a/Sources/bowlin_project/lib/views/ingame_screen2.dart b/Sources/bowlin_project/lib/views/ingame_screen2.dart index 3d11b9a..0cfcad0 100644 --- a/Sources/bowlin_project/lib/views/ingame_screen2.dart +++ b/Sources/bowlin_project/lib/views/ingame_screen2.dart @@ -3,11 +3,7 @@ import 'package:bowl_in/model/AbstractRound.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; - -import '../model/Round.dart'; -import '../widgets/button_new_party.dart'; import '../widgets/ingame_widgets.dart'; -import '../widgets/scores_list_widget.dart'; class InGameScreen2 extends StatefulWidget { final AbstractRound currentRound; @@ -93,8 +89,8 @@ class _InGameScreen2State extends State { width: 7, color: Color(0xff1ABAE0), ), - onPrimary: Colors.transparent, - primary: Colors.transparent, + backgroundColor: Colors.transparent, + foregroundColor: Colors.transparent, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(55), ), diff --git a/Sources/bowlin_project/lib/views/welcome_screen.dart b/Sources/bowlin_project/lib/views/welcome_screen.dart index 4ee80bf..ed60124 100644 --- a/Sources/bowlin_project/lib/views/welcome_screen.dart +++ b/Sources/bowlin_project/lib/views/welcome_screen.dart @@ -66,8 +66,8 @@ class ButtonConnexion extends StatelessWidget { width: 7, color: Color(0xffFF419B), ), - onPrimary: Colors.white, - primary: Color(0xffF40375), + foregroundColor: Colors.white, + backgroundColor: Color(0xffF40375), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(35), ), diff --git a/Sources/bowlin_project/lib/widgets/button_new_party.dart b/Sources/bowlin_project/lib/widgets/button_new_party.dart index e31275e..076d0ea 100644 --- a/Sources/bowlin_project/lib/widgets/button_new_party.dart +++ b/Sources/bowlin_project/lib/widgets/button_new_party.dart @@ -3,11 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; - -import '../main.dart'; import '../model/GameDetail.dart'; -import '../model/Player.dart'; -import '../model/User.dart'; import 'ingame_widgets.dart'; class ButtonNewParty extends StatelessWidget { @@ -21,8 +17,8 @@ class ButtonNewParty extends StatelessWidget { width: 4, color: Color(0xffFF419B), ), - onPrimary: Colors.white, - primary: Color(0xffF40375), + foregroundColor: Colors.white, + backgroundColor: Color(0xffF40375), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(35), ), @@ -127,8 +123,8 @@ class NewGameModal extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 18), ), style: ElevatedButton.styleFrom( - onPrimary: Colors.white, - primary: Color(0xffF40375), + foregroundColor: Colors.white, + backgroundColor: Color(0xffF40375), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), @@ -229,8 +225,8 @@ class ButtonJoinParty extends StatelessWidget { width: 4, color: Color(0xff6B6588), ), - onPrimary: Colors.white, - primary: Color(0xff45405D), + foregroundColor: Colors.white, + backgroundColor: Color(0xff45405D), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(35), ), diff --git a/Sources/bowlin_project/lib/widgets/ingame_widgets.dart b/Sources/bowlin_project/lib/widgets/ingame_widgets.dart index 8b9cf57..1f95c54 100644 --- a/Sources/bowlin_project/lib/widgets/ingame_widgets.dart +++ b/Sources/bowlin_project/lib/widgets/ingame_widgets.dart @@ -1,13 +1,9 @@ import 'dart:ui'; - import 'package:bowl_in/main.dart'; -import 'package:bowl_in/widgets/profil_listpodium_widget.dart'; -import 'package:bowl_in/widgets/scores_list_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; - import '../model/AbstractRound.dart'; import '../model/GameDetail.dart'; import '../model/Guest.dart'; @@ -170,8 +166,8 @@ class _FinalScoreBoardState extends State { width: 7, color: Color(0xff1ABAE0), ), - onPrimary: Colors.transparent, - primary: Colors.transparent, + foregroundColor: Colors.transparent, + backgroundColor: Colors.transparent, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(55), ), @@ -252,7 +248,8 @@ class PodiumGameOverWidget extends StatelessWidget { class InGameCardConfig extends StatefulWidget { final List listPlayer; - const InGameCardConfig({Key? key, required this.listPlayer}) : super(key: key); + const InGameCardConfig({Key? key, required this.listPlayer}) + : super(key: key); @override State createState() => _InGameCardConfigState(); @@ -264,16 +261,14 @@ class _InGameCardConfigState extends State { super.initState(); } - void onDelete(Player p){ + void onDelete(Player p) { setState(() { - widget.listPlayer.remove(p); }); } - void onReorder(int oldIndex, int newIndex){ + void onReorder(int oldIndex, int newIndex) { setState(() { - if (oldIndex < newIndex) { newIndex -= 1; } @@ -325,7 +320,11 @@ class _InGameCardConfigState extends State { ], ), )), - ListUserInGame(listPlayer: widget.listPlayer, onDelete: onDelete, onReorder: onReorder,), + ListUserInGame( + listPlayer: widget.listPlayer, + onDelete: onDelete, + onReorder: onReorder, + ), Spacer(), Image( image: AssetImage("assets/images/start_sentence.png"), @@ -350,7 +349,7 @@ class _InGameCardConfigState extends State { style: ElevatedButton.styleFrom( elevation: 5, shadowColor: Color(0xffB70056), - primary: Color(0xffF40375), + backgroundColor: Color(0xffF40375), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), @@ -367,14 +366,18 @@ class ListUserInGame extends StatefulWidget { final List listPlayer; final Function(Player) onDelete; final Function(int, int) onReorder; - const ListUserInGame({Key? key, required this.listPlayer, required this.onDelete, required this.onReorder}) : super(key: key); + const ListUserInGame( + {Key? key, + required this.listPlayer, + required this.onDelete, + required this.onReorder}) + : super(key: key); @override State createState() => _ListUserInGameState(); } class _ListUserInGameState extends State { - @override Widget build(BuildContext context) { return Padding( @@ -388,10 +391,14 @@ class _ListUserInGameState extends State { ), child: ReorderableListView.builder( itemCount: widget.listPlayer.length, - itemBuilder: (context, index) { - return UserInGame(key:ValueKey(widget.listPlayer[index]) ,player: widget.listPlayer[index], onDelete: widget.onDelete, index: index); - }, - onReorder: widget.onReorder, + itemBuilder: (context, index) { + return UserInGame( + key: ValueKey(widget.listPlayer[index]), + player: widget.listPlayer[index], + onDelete: widget.onDelete, + index: index); + }, + onReorder: widget.onReorder, ), ), RichText( @@ -418,7 +425,12 @@ class UserInGame extends StatefulWidget { final Player player; final Function(Player) onDelete; final int index; - const UserInGame({Key? key, required this.player, required this.onDelete, required this.index}) : super(key: key); + const UserInGame( + {Key? key, + required this.player, + required this.onDelete, + required this.index}) + : super(key: key); @override State createState() => _UserInGameState(); @@ -442,17 +454,17 @@ class _UserInGameState extends State { child: Row( children: [ ReorderableDragStartListener( - index: widget.index, - child : Container( - width: 30, - height: 30, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(70)), - image: DecorationImage( - image: AssetImage(widget.player.image), fit: BoxFit.cover), + index: widget.index, + child: Container( + width: 30, + height: 30, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(70)), + image: DecorationImage( + image: AssetImage(widget.player.image), fit: BoxFit.cover), + ), ), ), - ), SizedBox( width: 10, ), @@ -472,29 +484,26 @@ class _UserInGameState extends State { ), cursorColor: Colors.purple, textAlign: TextAlign.left, - onChanged: (str)=> widget.player.name=str - , + onChanged: (str) => widget.player.name = str, ), ), ) : SizedBox( width: 220, - child: Text( - widget.player.name, - style: GoogleFonts.roboto( - fontSize: 18, - decoration: TextDecoration.none, - color: Color(0xff241E40)) - ), + child: Text(widget.player.name, + style: GoogleFonts.roboto( + fontSize: 18, + decoration: TextDecoration.none, + color: Color(0xff241E40))), ), - (widget.player is User && (widget.player as User).id == MyApp.controller.userCurrent.id) ? - Icon(Icons.lock, color: Colors.amber) : - GestureDetector( - onTap: () { - widget.onDelete(widget.player); - }, - child: Icon(Icons.close) - ), + (widget.player is User && + (widget.player as User).id == MyApp.controller.userCurrent.id) + ? Icon(Icons.lock, color: Colors.amber) + : GestureDetector( + onTap: () { + widget.onDelete(widget.player); + }, + child: Icon(Icons.close)), Spacer() ], ), @@ -518,8 +527,6 @@ class InGameCardThrow extends StatefulWidget { } class _InGameCardThrowState extends State { - GlobalKey<_NumberPadState> _numberPadKey = GlobalKey(); - void initState() { super.initState(); } diff --git a/Sources/bowlin_project/lib/widgets/profil_listpodium_widget.dart b/Sources/bowlin_project/lib/widgets/profil_listpodium_widget.dart index a4c1a90..62f7e0a 100644 --- a/Sources/bowlin_project/lib/widgets/profil_listpodium_widget.dart +++ b/Sources/bowlin_project/lib/widgets/profil_listpodium_widget.dart @@ -2,9 +2,7 @@ import 'package:bowl_in/widgets/scores_list_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; - import '../main.dart'; -import '../model/Player.dart'; import '../model/User.dart'; class ProfilPodiumWidget extends StatelessWidget { diff --git a/Sources/bowlin_project/lib/widgets/scores_list_widget.dart b/Sources/bowlin_project/lib/widgets/scores_list_widget.dart index c66c665..a9716a9 100644 --- a/Sources/bowlin_project/lib/widgets/scores_list_widget.dart +++ b/Sources/bowlin_project/lib/widgets/scores_list_widget.dart @@ -2,7 +2,6 @@ import 'package:bowl_in/main.dart'; import 'package:bowl_in/widgets/button_new_party.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:intl/date_symbol_data_local.dart'; import 'package:intl/intl.dart'; diff --git a/Sources/bowlin_project/pubspec.lock b/Sources/bowlin_project/pubspec.lock index 248abaf..17478e3 100644 --- a/Sources/bowlin_project/pubspec.lock +++ b/Sources/bowlin_project/pubspec.lock @@ -156,10 +156,10 @@ packages: dependency: "direct main" description: name: go_router - sha256: e2a90e1d4eed378ea12e0771be9e32766a2f8d2de3064e42f3a55f1b04fb8af8 + sha256: b90b9aaa7723ca7159a81c0cd3be8108c74c986c3fbc41d413fd82ea164733ea url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "6.4.0" google_fonts: dependency: "direct main" description: diff --git a/Sources/bowlin_project/test/manager_test.dart b/Sources/bowlin_project/test/manager_test.dart new file mode 100644 index 0000000..62b237c --- /dev/null +++ b/Sources/bowlin_project/test/manager_test.dart @@ -0,0 +1,37 @@ +import 'package:bowl_in/model/GameDetail.dart'; +import 'package:bowl_in/model/Guest.dart'; +import 'package:bowl_in/model/IManager.dart'; +import 'package:bowl_in/model/Player.dart'; +import 'package:bowl_in/model/StubManager/StubData.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void testManager(IManager mgr) { + test("Test manager " + mgr.runtimeType.toString(), () { + expect(mgr.userCurrent, mgr.userMgr.getUsersByName("Dave").first); + expect(mgr.userCurrent, mgr.userMgr.getUserById(mgr.userCurrent.id)); + + List players = [mgr.userCurrent, Guest("Emre")]; + GameDetail gd = GameDetail( + mgr.gameMgr.getNextId(), DateTime.now(), null, mgr.userCurrent.id, players); + + expect(gd.players, players); + expect(gd.host, mgr.userCurrent.id); + + + mgr.gameMgr.addGame(gd); + + expect(gd, mgr.gameMgr.getGameById(gd.id)); + + expect(gd, mgr.gameMgr.getGamesByPlayer(mgr.userCurrent).first); + + expect(gd, mgr.gameMgr.getGamesByPlayerId(mgr.userCurrent.id).first); + + expect(players, mgr.gameMgr.getPlayersByIdGame(gd.id)); + + expect(gd, mgr.gameMgr.getGamesByPlayers(players).first); + }); +} + +void main() { + testManager(StubData()); +} diff --git a/Sources/bowlin_project/test/model_test.dart b/Sources/bowlin_project/test/model.dart similarity index 100% rename from Sources/bowlin_project/test/model_test.dart rename to Sources/bowlin_project/test/model.dart diff --git a/Sources/bowlin_project/test/play_test.dart b/Sources/bowlin_project/test/play_test.dart new file mode 100644 index 0000000..4ecbc1e --- /dev/null +++ b/Sources/bowlin_project/test/play_test.dart @@ -0,0 +1,140 @@ +import 'package:bowl_in/model/AbstractRound.dart'; +import 'package:bowl_in/model/GameDetail.dart'; +import 'package:bowl_in/model/GamePlayer.dart'; +import 'package:bowl_in/model/Guest.dart'; +import 'package:bowl_in/model/IManager.dart'; +import 'package:bowl_in/model/Player.dart'; +import 'package:bowl_in/model/StubManager/StubData.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + test("Just strikes", (){ + final IManager mgr = StubData(); + final List listPlayers = [mgr.userCurrent, Guest("Lucas")]; + + final GameDetail gd = GameDetail( + -1, + DateTime.now(), + null, + mgr.userCurrent.id, + listPlayers); + mgr.gamePlayer.game = gd; + mgr.gamePlayer.onNext(false, null); + + AbstractRound? currentRound = mgr.gamePlayer.currentRound; + while (currentRound != null) { + bool isFinished = currentRound.computeNext(10); + if (currentRound.isSpareOrStrike()) { + mgr.gamePlayer.onSpareOrStrike(); + } + mgr.gamePlayer.onNext(isFinished, null); + currentRound = mgr.gamePlayer.currentRound; + } + + final int score = gd + .getRank() + .values + .first; + expect(score, 300); + }); + + test("Classic game", (){ + final IManager mgr = StubData(); + final List listPlayers = [mgr.userCurrent, Guest("Lucas")]; + + final DateTime dateGame = DateTime.now(); + + final GameDetail gd = GameDetail( + -1, + dateGame, + null, + mgr.userCurrent.id, + listPlayers); + mgr.gamePlayer.game = gd; + mgr.gamePlayer.onNext(false, null); + + makeThrow(7, mgr.gamePlayer); + makeThrow(2, mgr.gamePlayer); + + makeThrow(10, mgr.gamePlayer); + + makeThrow(5, mgr.gamePlayer); + makeThrow(5, mgr.gamePlayer); + + makeThrow(5, mgr.gamePlayer); + makeThrow(5, mgr.gamePlayer); + + makeThrow(3, mgr.gamePlayer); + makeThrow(7, mgr.gamePlayer); + + makeThrow(0, mgr.gamePlayer); + makeThrow(7, mgr.gamePlayer); + + makeThrow(10, mgr.gamePlayer); + + makeThrow(0, mgr.gamePlayer); + makeThrow(0, mgr.gamePlayer); + + makeThrow(9, mgr.gamePlayer); + makeThrow(0, mgr.gamePlayer); + + makeThrow(0, mgr.gamePlayer); + makeThrow(10, mgr.gamePlayer); + + makeThrow(2, mgr.gamePlayer); + makeThrow(2, mgr.gamePlayer); + + makeThrow(5, mgr.gamePlayer); + makeThrow(5, mgr.gamePlayer); + + makeThrow(10, mgr.gamePlayer); + + makeThrow(3, mgr.gamePlayer); + makeThrow(2, mgr.gamePlayer); + + makeThrow(1, mgr.gamePlayer); + makeThrow(2, mgr.gamePlayer); + + makeThrow(7, mgr.gamePlayer); + makeThrow(1, mgr.gamePlayer); + + makeThrow(4, mgr.gamePlayer); + makeThrow(6, mgr.gamePlayer); + + makeThrow(1, mgr.gamePlayer); + makeThrow(7, mgr.gamePlayer); + + makeThrow(10, mgr.gamePlayer); + makeThrow(6, mgr.gamePlayer); + makeThrow(2, mgr.gamePlayer); + + makeThrow(8, mgr.gamePlayer); + makeThrow(1, mgr.gamePlayer); + + + + final Iterable score = gd + .getRank() + .values; + expect(score.first, 128); + expect(score.last, 95); + + expect(mgr.userCurrent.games.length, 1); + expect(mgr.userCurrent.games.first.id, mgr.gamePlayer.game.id); + expect(mgr.userCurrent.games.first.pointsCurrentUser, 128); + expect(mgr.userCurrent.games.first.date, dateGame); + expect(mgr.userCurrent.games.first.players, listPlayers); + + }); + +} + + +void makeThrow(int input, GamePlayer gamePlayer){ + AbstractRound currentRound = gamePlayer.currentRound!; + bool isFinished = currentRound.computeNext(input); + if (currentRound.isSpareOrStrike()) { + gamePlayer.onSpareOrStrike(); + } + gamePlayer.onNext(isFinished, null); +} \ No newline at end of file diff --git a/Sources/bowlin_project/test/round_test.dart b/Sources/bowlin_project/test/round_test.dart new file mode 100644 index 0000000..134a599 --- /dev/null +++ b/Sources/bowlin_project/test/round_test.dart @@ -0,0 +1,84 @@ +import 'package:bowl_in/model/LastRound.dart'; +import 'package:bowl_in/model/Round.dart'; +import 'package:bowl_in/model/User.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + test("Test Round", () { + User u = User( + 1, + "Louison", + "Sources/bowlin_project/assets/images/image_user_pink.png", + "loparant@gmail.com", [], []); + Round r = Round(null, null, null, u, 1); + + expect(r.getMaxPinsThisShot(), 10); + expect(r.isSpareOrStrike(), false); + + r.computeNext(4); + + expect(r.getMaxPinsThisShot(), 6); + r.computeNext(6); + + expect(r.isSpare(), true); + expect(r.isSpareOrStrike(), true); + expect(r.isStrike(), false); + expect(r.getNbSpares(), 1); + expect(r.getNbStrike(), 0); + + Round r2 = Round(null, null, null, u, 2); + r2.computeNext(10); + expect(r2.isSpare(), false); + expect(r2.isStrike(), true); + expect(r2.isSpareOrStrike(), true); + expect(r2.getNbSpares(), 0); + expect(r2.getNbStrike(), 1); + + Round r3 = Round(null, null, null, u, 2); + r3.computeNext(2); + r3.computeNext(5); + expect(r3.getPinsKnockedDown(), 7); + }); + + test("Test LastRound", () { + User u = User( + 1, + "Louison", + "Sources/bowlin_project/assets/images/image_user_pink.png", + "loparant@gmail.com", [], []); + LastRound r = LastRound(null, null, null, u, 1, null); + + expect(r.getMaxPinsThisShot(), 10); + expect(r.isSpareOrStrike(), false); + r.computeNext(10); + + expect(r.getMaxPinsThisShot(), 10); + r.computeNext(10); + + expect(r.getMaxPinsThisShot(), 10); + r.computeNext(10); + + expect(r.getPinsKnockedDown(), 30); + expect(r.getNbSpares(), 0); + expect(r.getNbStrike(), 3); + + LastRound r2 = LastRound(null, null, null, u, 1, null); + r2.computeNext(1); + expect(r2.getMaxPinsThisShot(), 9); + r2.computeNext(9); + expect(r2.getMaxPinsThisShot(), 10); + r2.computeNext(10); + expect(r2.getPinsKnockedDown(), 20); + expect(r2.getNbSpares(), 1); + expect(r2.getNbStrike(), 1); + + LastRound r3 = LastRound(null, null, null, u, 1, null); + r3.computeNext(10); + r3.computeNext(2); + expect(r3.getMaxPinsThisShot(), 8); + r3.computeNext(8); + expect(r3.getPinsKnockedDown(), 20); + expect(r3.getNbSpares(), 1); + expect(r3.getNbStrike(), 1); + }); +} diff --git a/Sources/bowlin_project/test/widget_test.dart b/Sources/bowlin_project/test/widget_test.dart deleted file mode 100644 index a0aaeac..0000000 --- a/Sources/bowlin_project/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:bowl_in/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -}